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.1b6.tar.gz
(13.3 kB
view details)
Built Distribution
File details
Details for the file ydb_dbapi-0.0.1b6.tar.gz
.
File metadata
- Download URL: ydb_dbapi-0.0.1b6.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42c4328207a8cbb50e13cf05a82a23406b4837a620061acf9f925d7453731d54 |
|
MD5 | c58cbdef6f48702f8c0dd8e024a4673b |
|
BLAKE2b-256 | 0327f1d887a879f724c0206d500c73c8cb3aff5e16f75766a3dc0346c4773f39 |
File details
Details for the file ydb_dbapi-0.0.1b6-py3-none-any.whl
.
File metadata
- Download URL: ydb_dbapi-0.0.1b6-py3-none-any.whl
- Upload date:
- Size: 13.9 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 | 34949aa18db06f48090072b2b83d1e7cc0601609807f0e5f6daeb2d73e244985 |
|
MD5 | 540544473f7d7f6555a7cc1b1ad97e0a |
|
BLAKE2b-256 | f7b0681ba7321103befd8825781cdeebbe4a86cc5f44f55cc9003975309e2d8a |