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.12.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.12-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ydb_dbapi-0.1.12.tar.gz
Algorithm Hash digest
SHA256 8aa024bb413af66727451b03142fb1974697905229814b5a9970e31dcb489f2b
MD5 42e1509b82802d7be162861ff5dcbced
BLAKE2b-256 705077298482029e5f33c83d6d6354ee1f5267264a0b56803934f858c750602b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ydb_dbapi-0.1.12-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.10

File hashes

Hashes for ydb_dbapi-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 111a2e428771ec2d11d9a1b1536925a59bffaea84ba142afbc8fdd5220528813
MD5 3940859d6a985ee64fa0530e78da40c9
BLAKE2b-256 c0f826abbafeda835ba64985cf022ccf6f178ab21e0388b9d38ba88e08f77ed8

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