Skip to main content

YDB Dialect for SQLAlchemy

Project description

YDB Dialect for SQLAlchemy


License Functional tests Style checks

This repository contains work in progress YQL dialect for SqlAlchemy 2.0. Api may be changed in future without backward compatibility.

Installation

To work with current ydb-sqlalchemy version clone this repo and run from source root:

$ pip install -U .

Getting started

Connect to local YDB using SqlAlchemy:

import sqlalchemy as sa


engine = sa.create_engine("yql+ydb://localhost:2136/local")

with engine.connect() as conn:
  rs = conn.execute(sa.text("SELECT 1 AS value"))
  print(rs.fetchone())

Development

Run Tests:

Run the command from the root directory of the repository to start YDB in a local docker container.

$ docker-compose up

To run all tests execute the command from the root directory of the repository:

$ tox -e test-all

Run specific test:

$ tox -e test -- test_dbapi/test_dbapi.py

Check code style:

$ tox -e style

Reformat code:

$ tox -e isort
$ tox -e black-format

Run example (needs running local YDB):

$ python -m pip install virtualenv
$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ python examples/example.py

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_sqlalchemy-0.0.1b24.tar.gz (37.8 kB view details)

Uploaded Source

Built Distribution

ydb_sqlalchemy-0.0.1b24-py2.py3-none-any.whl (42.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ydb_sqlalchemy-0.0.1b24.tar.gz.

File metadata

  • Download URL: ydb_sqlalchemy-0.0.1b24.tar.gz
  • Upload date:
  • Size: 37.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.8

File hashes

Hashes for ydb_sqlalchemy-0.0.1b24.tar.gz
Algorithm Hash digest
SHA256 4b0f0ab3b03876d827efae7febfa3cf0406b2125786d292e187390bbe9e6ecf1
MD5 e090f1f4b244ed9367f6bc68dffe15ef
BLAKE2b-256 ea88cec249f1174ce78e3662c487c6058b1c073f3d136660ce4f5e69639bb07d

See more details on using hashes here.

File details

Details for the file ydb_sqlalchemy-0.0.1b24-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for ydb_sqlalchemy-0.0.1b24-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 07d4c688afd4c6ee8e5b734ca3fdbcb8ab0ef153dfa426e30edf1c7657bfb4d5
MD5 6f03ae895acc0070270e28bed30eb53f
BLAKE2b-256 bcc2f0f1adf3171617be6e821d05bcafe80d2eb806a45a9222347149bd101a86

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page