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.1b15.tar.gz (34.8 kB view details)

Uploaded Source

Built Distribution

ydb_sqlalchemy-0.0.1b15-py2.py3-none-any.whl (39.1 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: ydb_sqlalchemy-0.0.1b15.tar.gz
  • Upload date:
  • Size: 34.8 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.1b15.tar.gz
Algorithm Hash digest
SHA256 57315ac95f3af7e191038f0fec3748feb68edb09fe00a1c97f0d25652a7ed0f7
MD5 c55030de6d1d9720b77213bafd32013d
BLAKE2b-256 b914ed88a56264d0d77c823737cea15ad2728cb8208fc270fa419fe1839dc86b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ydb_sqlalchemy-0.0.1b15-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d0a66f74439508f87b4e08d382887f7f759b97b16b2127faa5a2857fb17e6a08
MD5 5b9a8da7166847fcfe91cfbecad080f8
BLAKE2b-256 31f9c2a055e9e50d9a957131ed4e86a6f81c5509bcf9ee52c68a5b9bc2869c28

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