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

Uploaded Source

Built Distribution

ydb_dbapi-0.0.1b8-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ydb_dbapi-0.0.1b8.tar.gz
  • Upload date:
  • Size: 13.7 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.1b8.tar.gz
Algorithm Hash digest
SHA256 6626d46ca85d486713499fab17b9835a74c11907861a136c075bd293cedb8e06
MD5 0c0bd5ee9d02b652e07d8103ff322a9c
BLAKE2b-256 9e50291011b87b473c55d963c048bbad3f7541aa7ac8e9ffccec19783ab35265

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ydb_dbapi-0.0.1b8-py3-none-any.whl
  • Upload date:
  • Size: 14.4 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.1b8-py3-none-any.whl
Algorithm Hash digest
SHA256 2c913206f5a377534e892c13b798a7c979212ac5915bb2fb57656cd8249e092f
MD5 57dcb1f58dfc8b2c8e27498019f7a05d
BLAKE2b-256 3fdb108ab9f185892a499fead9d9ed38f07646f19181fdbb026b5c6a5ad1815b

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