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.1b1.tar.gz
(12.9 kB
view details)
Built Distribution
File details
Details for the file ydb_dbapi-0.0.1b1.tar.gz
.
File metadata
- Download URL: ydb_dbapi-0.0.1b1.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29b469539271ed86f0556d66c687310330e19f785a0da494c0dadb2c3429c115 |
|
MD5 | 688cc8c046d42815337451ec4c6241a3 |
|
BLAKE2b-256 | 124096225e47687dc264144dd7da162073c07031c318ed7615d43a346557a220 |
File details
Details for the file ydb_dbapi-0.0.1b1-py3-none-any.whl
.
File metadata
- Download URL: ydb_dbapi-0.0.1b1-py3-none-any.whl
- Upload date:
- Size: 13.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 | 4cf7d4751c473f601d03c20de61caa948bc4dd0db5b7349891cfe07ae9ab955c |
|
MD5 | e2887bcbb750fc1641a7b1586e68cfa0 |
|
BLAKE2b-256 | b94ffbc5303edccc9d478eb560a8b93998388f4a0697a2f04015289f8c6c0e30 |