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

Uploaded Source

Built Distribution

ydb_dbapi-0.1.1-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ydb_dbapi-0.1.1.tar.gz
  • Upload date:
  • Size: 13.8 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.1.tar.gz
Algorithm Hash digest
SHA256 4dda176cdf1a0925ea242c1bc9d1e3f4dd06f506e775567d322dadc31f9e9b51
MD5 9e1bb666bc53a41398e8b3d1cc004063
BLAKE2b-256 446900f82ea8a06ba8324a861ba76c0cb81140f2c216aa3adea31a06f43d8bd8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ydb_dbapi-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 75ec05a1a5d949fd93528895f3e703ec94299b9411988010f3ceb329f11572d8
MD5 1a8759dedc5d5ebb35331e323cdd3bbf
BLAKE2b-256 da780a8ce0ca0966e7cd6f55ed37c80352d1707a897209fc503cba239221f0ac

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