Skip to main content

YDB Dialect for SQLAlchemy

Project description

YDB Dialect for SQLAlchemy


License Functional tests Style checks

This repository contains YQL dialect for SqlAlchemy 2.0.

Note: Dialect also works with SqlAlchemy 1.4, but it is not fully tested.

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/test_core.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.1.3.tar.gz (30.9 kB view details)

Uploaded Source

Built Distribution

ydb_sqlalchemy-0.1.3-py2.py3-none-any.whl (35.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ydb_sqlalchemy-0.1.3.tar.gz.

File metadata

  • Download URL: ydb_sqlalchemy-0.1.3.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.7

File hashes

Hashes for ydb_sqlalchemy-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a8dc00462334c1cc7d11858d980cae438409b38b15ea3f2fc0f6b08cdf1e750b
MD5 88be28bafd02c627366438f1f0319b94
BLAKE2b-256 9482b10e128d26f60c8ad7d14c6b2f450ca95d2d176bd254c66682064900c189

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ydb_sqlalchemy-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3f4b05fb737c25e3beef9b070541d4db5f2dc4243be045d10b25cf538b6bb156
MD5 b2f0f45debcd7027417ef57135c9cc5d
BLAKE2b-256 923cb6f07bc9dbde8672d1e862e8c7b3d30782bedfc54c85e567e24a0ca942d0

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 Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page