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

Run the command from the root directory of the repository to start YDB in a local docker container.

$ docker-compose up

To run all tests execute the command from the root directory of the repository:

$ tox -e test-all

Run specific test:

$ tox -e test -- test/test_core.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.1.0.tar.gz (30.1 kB view details)

Uploaded Source

Built Distribution

ydb_sqlalchemy-0.1.0-py2.py3-none-any.whl (32.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ydb_sqlalchemy-0.1.0.tar.gz.

File metadata

  • Download URL: ydb_sqlalchemy-0.1.0.tar.gz
  • Upload date:
  • Size: 30.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.7

File hashes

Hashes for ydb_sqlalchemy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 83224f55580b8df2e997bb5a3677c373a40a730840c23e08505f22d625032e43
MD5 a09fdffa61cf605ba1938bdb88250a09
BLAKE2b-256 c0e0c85e001109e93b12c2cfb99ae547832dd6cc65d0680e460d002e01156767

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ydb_sqlalchemy-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7a15429a6d3ea826e2472749039c525307e5bcb16fa38c650b1c011f780c9cc7
MD5 e57e01b161d0d1d547eb643e5c264692
BLAKE2b-256 cecdfc906f910ed7b6eb82be569c00e497bd5eda73261d5194f2fb0cc677cfad

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