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 throw 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:

For run local YDB throw docker, run in source root:

$ docker-compose up

For run all tests from source root make:

$ 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.1b13.tar.gz (32.5 kB view details)

Uploaded Source

Built Distribution

ydb_sqlalchemy-0.0.1b13-py2.py3-none-any.whl (36.9 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for ydb_sqlalchemy-0.0.1b13.tar.gz
Algorithm Hash digest
SHA256 c862b33f46d3f388bc1716a397d33568c7496378d341c5ca3ced4a16bf2a70bf
MD5 ebfc815727369a8dd7f794b73464882c
BLAKE2b-256 6354d240f1ad602298d8e94704d41cf3ac133155348c8cbd1c6f8a9ef3090e9f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ydb_sqlalchemy-0.0.1b13-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d47aa6c4abda05c2d86ee961c2f6793e224ec6fc8c7babf4c0c5158d0c42eede
MD5 1e67193a91bddf524641bb7f1c18f204
BLAKE2b-256 d31261f3e7f8dca1e2d5d7d03f8ecd9028b10ceb47a77ccf520928663dddaa5b

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