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_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.1b22.tar.gz (37.2 kB view details)

Uploaded Source

Built Distribution

ydb_sqlalchemy-0.0.1b22-py2.py3-none-any.whl (41.5 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: ydb_sqlalchemy-0.0.1b22.tar.gz
  • Upload date:
  • Size: 37.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.6

File hashes

Hashes for ydb_sqlalchemy-0.0.1b22.tar.gz
Algorithm Hash digest
SHA256 c6a58884c0446761eee0bb1e238057ed9382bdcffd90186c1d7502edee218699
MD5 28c511bd4f89f6d53ceb16698fab836f
BLAKE2b-256 80c1e1e1849f5721deeaa3a56ef565a393a0b5a317753f6437ce9cb3f2c3a809

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ydb_sqlalchemy-0.0.1b22-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3399fab1248ce3032b4db81d8a434fc6f28ebbb79425b99ea82d83ba25dbb214
MD5 77a0e9b96278cee1e30438d9cea168b2
BLAKE2b-256 c1b362fa8c531f90b63b3310b744194f84b2f0f655cc0eb3c2640f93178c77fc

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