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.1b8.tar.gz
(31.4 kB
view details)
Built Distribution
File details
Details for the file ydb-sqlalchemy-0.0.1b8.tar.gz
.
File metadata
- Download URL: ydb-sqlalchemy-0.0.1b8.tar.gz
- Upload date:
- Size: 31.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d658f01503081f5c14563418a11c8ddc0652e5bc0d2992624967fe2b317cfcf7 |
|
MD5 | 0d75382272bea30b3431e697edd2df4b |
|
BLAKE2b-256 | a7d3f9f9da00584b7fc5b8b8c119b5c3f94c1f715e5d3f5311cd5675290e5af4 |
File details
Details for the file ydb_sqlalchemy-0.0.1b8-py2.py3-none-any.whl
.
File metadata
- Download URL: ydb_sqlalchemy-0.0.1b8-py2.py3-none-any.whl
- Upload date:
- Size: 35.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e92a063276f0eda2d41bb9228f0416e3853de703ea5deb94c7046a0bd81113f |
|
MD5 | 0ce53d803515ebc2170f16eae14d17ec |
|
BLAKE2b-256 | 1f5e64fd64400fa8e7787450234cdaacef334008b6fb215dd99a8c18c69aa242 |