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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ydb_dbapi-0.1.7.tar.gz
Algorithm Hash digest
SHA256 3416eb5657c9a8925eaae43ae3c9929ab4feadb93ff8682ffb16d5d60f637bf7
MD5 facd5992e4d81e5ae93b8ca3cba20079
BLAKE2b-256 918919272fb0fd395985ed1606d3ee48922455099fe3baa284233bbfc5b1fecf

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ydb_dbapi-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b31a5e45fc07c90c6efa97a97c2a9876a882b5fbfa713a246e43cda02b165dd9
MD5 fb71ded7f577a28bbdac51550224e566
BLAKE2b-256 53bb44cb90b69c5f6dee0413860395a8471372d97a9b602cf518b8fd98f4e41b

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