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

Uploaded Source

Built Distribution

ydb_sqlalchemy-0.0.1b12-py2.py3-none-any.whl (35.8 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: ydb_sqlalchemy-0.0.1b12.tar.gz
  • Upload date:
  • Size: 31.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.1b12.tar.gz
Algorithm Hash digest
SHA256 a3dc45c226fdeaec260c06bfe12f0a9a5d25d7e6ee6b146474a2ec25961b13ac
MD5 ffa58257684257c016f76a385721cd35
BLAKE2b-256 574e214818d717ea6065a4fb51bf617d006af90bedc5a948af5a608fa7cc7fc2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ydb_sqlalchemy-0.0.1b12-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c79e1f1eb1652eb012a02cbfdc37f24dde712edff08acb4602e915fa011007a2
MD5 fc96d20578f095c9fbc59c39a0010353
BLAKE2b-256 3cda43a241ff65f0171e673b91831202b3783a85f184e1dd91f1d979ce4a4089

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page