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.1b7.tar.gz
(13.3 kB
view details)
Built Distribution
File details
Details for the file ydb_dbapi-0.0.1b7.tar.gz
.
File metadata
- Download URL: ydb_dbapi-0.0.1b7.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 | 0c5b337162445812339cb4c9c1f95e1e51a1c3ae30c367a4174f1ad03ec1a227 |
|
MD5 | daf96098fe52aeca5b753d4d1213b693 |
|
BLAKE2b-256 | d5a212c1dec122e829b94c786fe770450a98763f4b98286d0a6a257f9c751254 |
File details
Details for the file ydb_dbapi-0.0.1b7-py3-none-any.whl
.
File metadata
- Download URL: ydb_dbapi-0.0.1b7-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 | 2afad985ae88e71af0f3755aa7925835652059f6fdfebc362e719798570f1e9c |
|
MD5 | 02f445758a4a7e355df58d6326de7970 |
|
BLAKE2b-256 | b2e96c5775b522124b77f78e7c4e070d1b22b034fa5beec90906c6866ce33ac5 |