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

pip install ydb-dbapi

Usage

To establish a new DBAPI connection you should provide host, port and database:

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:

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:

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.1.3.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

ydb_dbapi-0.1.3-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file ydb_dbapi-0.1.3.tar.gz.

File metadata

  • Download URL: ydb_dbapi-0.1.3.tar.gz
  • Upload date:
  • Size: 14.0 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.1.3.tar.gz
Algorithm Hash digest
SHA256 a714f7d062309d90cd4f504471494ee8b456bcc2e82c7ab0e02339d2445b6fb9
MD5 ef51e4eb3cb4405e71aae52f0fcba70e
BLAKE2b-256 bda02d4b232819f0d0a5a9a9ef7899701ea376778d75ae51fccd854174fe9599

See more details on using hashes here.

File details

Details for the file ydb_dbapi-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: ydb_dbapi-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 14.8 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.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d1c46150f8b0198f2961f042fd1cc0c0ff19821877d98c4015238ff0443e17db
MD5 d4e795ec130e2c52062267f794ab9d2d
BLAKE2b-256 6ee684a224aaf1730d21ff80d53f0a88a1a00c84733a42edbd3464bc55025985

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