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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ydb_dbapi-0.1.10.tar.gz
Algorithm Hash digest
SHA256 ba9a466cb46dfb9d32266a1d395f19f30f912da9c2b1b68ffdeeb06aaec1243f
MD5 0b13c9cd39524a428ced2055e6457d8b
BLAKE2b-256 28cdda0a11703b3f8d17833c5dca3ae88108da76b7cf2d5021a4710f737c36c1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ydb_dbapi-0.1.10-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.9

File hashes

Hashes for ydb_dbapi-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 5f82f543a67c3023e744e3a890763b99d0bc48ff0c76708a946db6524dd4a560
MD5 a7ba12641731f17864d3675118293dd1
BLAKE2b-256 a1d7ba600812a27e2ce2c00f08d569a85860f313367e6b5fd6746b0b05514e01

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