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.1b4.tar.gz
(13.3 kB
view details)
Built Distribution
File details
Details for the file ydb_dbapi-0.0.1b4.tar.gz
.
File metadata
- Download URL: ydb_dbapi-0.0.1b4.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 | 2745d30c866cfb081ec20bd7ba36f7ef1e28cfa25a57cbcc687f6416855419ab |
|
MD5 | 4659296b52936e64df44432ee9711ce8 |
|
BLAKE2b-256 | c8b79338baaf7a13d85c682ea88216560137e3d52fee3bc57766246c7f5e0d6c |
File details
Details for the file ydb_dbapi-0.0.1b4-py3-none-any.whl
.
File metadata
- Download URL: ydb_dbapi-0.0.1b4-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 | d16111180b227faaa25a68aa85e32764e1ea715443a9d898a51868e25fe02e1e |
|
MD5 | 16eda0b4030e61feb60defa1f097f7a5 |
|
BLAKE2b-256 | e8ca5bed9be996b2dcba5ac7fe6968c38ec694c297a6cda92019b7fcf14a944d |