YDB Python DBAPI which complies with PEP 249
Project description
YDB Python DBAPI
Introduction
Python DBAPI to YDB
, which provides both sync and async drivers and complies with PEP249.
Installation
pip install ydb-dbapi
Usage
To establish a new DBAPI connection you should provide host
, port
and database
:
import ydb_dbapi
connection = ydb_dbapi.connect(
host="localhost", port="2136", database="/local"
) # sync connection
async_connection = await ydb_dbapi.async_connect(
host="localhost", port="2136", database="/local"
) # async connection
Usage of connection:
with connection.cursor() as cursor:
cursor.execute("SELECT id, val FROM table")
row = cursor.fetchone()
rows = cursor.fetchmany(size=5)
rows = cursor.fetchall()
Usage of async connection:
async with async_connection.cursor() as cursor:
await cursor.execute("SELECT id, val FROM table")
row = await cursor.fetchone()
rows = await cursor.fetchmany(size=5)
rows = await cursor.fetchall()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ydb_dbapi-0.1.2.tar.gz
(14.0 kB
view details)
Built Distribution
ydb_dbapi-0.1.2-py3-none-any.whl
(14.8 kB
view details)
File details
Details for the file ydb_dbapi-0.1.2.tar.gz
.
File metadata
- Download URL: ydb_dbapi-0.1.2.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0dc6c85cb15608b1a6335f26cdceca8994d74c8166491ebbc0ca3989a1d0f4f6 |
|
MD5 | c483fcdc0bade22a7d9387de97b5835c |
|
BLAKE2b-256 | 6b35002e33c6b01dd3dc84308bae81f1ee7cb97018956f262093de45477b77af |
File details
Details for the file ydb_dbapi-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: ydb_dbapi-0.1.2-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9315055b16ed01ffbe0f2d3327a983fc94d4aa8c807f0365b0aa441448fffb69 |
|
MD5 | 623713326367f0620f99a2c5e5e1daa5 |
|
BLAKE2b-256 | a3b3b4b033ad06039ff89756a443eecf10ed7b8ffcb8c27dc375be8ac1a7c4cb |