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.13.tar.gz (14.3 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.13-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ydb_dbapi-0.1.13.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.11

File hashes

Hashes for ydb_dbapi-0.1.13.tar.gz
Algorithm Hash digest
SHA256 179deff0cc6cffd1012e46dffcd0c6245cf56bf82a0f3127330e39391c3a8882
MD5 fcb5f9723ec1d7994c0ddcb413c699ce
BLAKE2b-256 78a9b3a07e687355b2787f624a1eba7615bf532bc52f81f7559f01ba1da71a75

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ydb_dbapi-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 7bfa019a9175e209bf7287facfddda28b580e5427ed1c95d91dab6522da943aa
MD5 7086bc316a60d8c4aa31acc3cbe177e3
BLAKE2b-256 052906bb2e45ca0576f3144ae6fbccfe457c65e00e96c1a042e345c9ebd81489

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