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
TBD after first release
Usage
To establish a new DBAPI connection you should provide host
, port
and database
:
```python
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:
```python
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:
```python
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.0.1b3.tar.gz
(13.2 kB
view details)
Built Distribution
File details
Details for the file ydb_dbapi-0.0.1b3.tar.gz
.
File metadata
- Download URL: ydb_dbapi-0.0.1b3.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bd0f5fee38a6393c8f536d6ccbf2dee8db5d54f498fe1d2eaf7df94fa07e2dc |
|
MD5 | fb924ad6deae7f4713769931bb548401 |
|
BLAKE2b-256 | c2d03c5394265110ad4e67302ded48bd3b255aaa5c886e4dab1339866569dd3d |
File details
Details for the file ydb_dbapi-0.0.1b3-py3-none-any.whl
.
File metadata
- Download URL: ydb_dbapi-0.0.1b3-py3-none-any.whl
- Upload date:
- Size: 13.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 | 3eebb99ecd0df9040ca893cfac8abd24c07fe7b9d888eb018d145d30f22beada |
|
MD5 | 05becd3c6fea15fdf5486ce5ba34c3d5 |
|
BLAKE2b-256 | 75a3f2c86d418e25978f5c211f5afc1693622f92426f20d19e2a3a1925d3aedb |