Skip to main content

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


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.1b2.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

ydb_dbapi-0.0.1b2-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file ydb_dbapi-0.0.1b2.tar.gz.

File metadata

  • Download URL: ydb_dbapi-0.0.1b2.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.7

File hashes

Hashes for ydb_dbapi-0.0.1b2.tar.gz
Algorithm Hash digest
SHA256 c7508a4b94d4e9bd48fdb2e7e7f639ed504249c0f11907765eadb7740527447c
MD5 6f7da14b7359b6496d8dabf1666775d9
BLAKE2b-256 536968198dbdacb402e7bbb211bd967a632cf3dc6eaee4d28b0e4cb3264266d7

See more details on using hashes here.

File details

Details for the file ydb_dbapi-0.0.1b2-py3-none-any.whl.

File metadata

  • Download URL: ydb_dbapi-0.0.1b2-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.7

File hashes

Hashes for ydb_dbapi-0.0.1b2-py3-none-any.whl
Algorithm Hash digest
SHA256 2e1d191d95b30243a6156383babb40a0e3c46b8ed6f850266dbaf86a4d612eb9
MD5 81d0df1f6d9c34c030bea52fbea4db30
BLAKE2b-256 2d28a714e731bf8e5d8d1c27d3eb857690155104c6d74f8f5b986b75dc7bbbe1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page