YDB Dialect for SQLAlchemy
Project description
YDB Dialect for SQLAlchemy
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
Release history Release notifications | RSS feed
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.1b14.tar.gz
(34.4 kB
view hashes)
Built Distribution
Close
Hashes for ydb_sqlalchemy-0.0.1b14-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01d65fb9e5b3bf890ecd0ed2f79a03c760cd2ae0c144577cf0615f50749e183f |
|
MD5 | a3c666ccca86b838746e63c20022247e |
|
BLAKE2b-256 | a01269daa05f763a1ffe0fe7fdb9b436d90fdea9a76afdadcf36b2ed2449f795 |