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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ydb_dbapi-0.1.5-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ydb_dbapi-0.1.5.tar.gz
  • Upload date:
  • Size: 14.2 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.5.tar.gz
Algorithm Hash digest
SHA256 7350cb63041e0f85f5a1253da6364bf0c0c7857ef0bdc40b8b0e4108153837ab
MD5 f1ca1b82a435ca3a2caf32af7df9025a
BLAKE2b-256 351b2aa580ea2f5aa5e1ba3a242d6bfc7e508302084702780254e184c5cd8034

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ydb_dbapi-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 14.9 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5e523187d5b181dd3941e97b41182c65514be88a1cb8366fcad1661f3401b8cf
MD5 2926ed1b692b82348b519405de86a7f3
BLAKE2b-256 51cab7b26a1f261aec4211cf97ca078579a15d51cdb230b95b1bdfebdd1760a1

See more details on using hashes here.

Supported by

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