ydb-dbapi-0.1.9
توضیحات
YDB Python DBAPI which complies with PEP 249
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | ydb-dbapi-0.1.9 |
| نام | ydb-dbapi |
| نسخه کتابخانه | 0.1.9 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Yandex LLC |
| ایمیل نویسنده | ydb@yandex-team.ru |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/ydb-dbapi/ |
| مجوز | - |
# YDB Python DBAPI
## Introduction
Python DBAPI to `YDB`, which provides both sync and async drivers and complies with [PEP249](https://www.python.org/dev/peps/pep-0249/).
## Installation
```shell
pip install ydb-dbapi
```
## 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()
```
نیازمندی
| مقدار | نام |
|---|---|
| - | ydb<4.0.0,>=3.24.0 |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| <4.0,>=3.8 | Python |
نحوه نصب
نصب پکیج whl ydb-dbapi-0.1.9:
pip install ydb-dbapi-0.1.9.whl
نصب پکیج tar.gz ydb-dbapi-0.1.9:
pip install ydb-dbapi-0.1.9.tar.gz