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.0.tar.gz
(13.8 kB
view details)
Built Distribution
ydb_dbapi-0.1.0-py3-none-any.whl
(14.5 kB
view details)
File details
Details for the file ydb_dbapi-0.1.0.tar.gz
.
File metadata
- Download URL: ydb_dbapi-0.1.0.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 451ac6fabd8001cb53df8df8990e1a1b9d5ac169e761351379bab81580e492ad |
|
MD5 | d7c8f0789c78c110abc5d75c3da28122 |
|
BLAKE2b-256 | 7673a7d4790e1ea46df58a3e6237bd4b628a41f6c608e8cb3900a0f27e576a7f |
File details
Details for the file ydb_dbapi-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: ydb_dbapi-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.5 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 | db05601e4ca93edf948371214e512cb4ba795d497e9b83a5410d0ee3d65252a1 |
|
MD5 | 49cc441e23c0ce41c9e593d6ece4039a |
|
BLAKE2b-256 | 8498d4bf1eb4f85386db520d87d3da2ec1b9149b7560278eb1f9d22aa7926c4b |