Skip to main content

YDB Dialect for SQLAlchemy

Project description

YDB Dialect for SQLAlchemy


License Functional tests Style checks

This repository contains YQL dialect for SqlAlchemy 2.0.

Note: Dialect also works with SqlAlchemy 1.4, but it is not fully tested.

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.4.tar.gz (31.0 kB view details)

Uploaded Source

Built Distribution

ydb_sqlalchemy-0.1.4-py2.py3-none-any.whl (35.4 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: ydb_sqlalchemy-0.1.4.tar.gz
  • Upload date:
  • Size: 31.0 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.4.tar.gz
Algorithm Hash digest
SHA256 ab696f940e7ea25fee44ea36ef2bbe6cc412563426322870f70e6d88a5256bbf
MD5 77d6c564e9b14fbc01782b7fb9a0e834
BLAKE2b-256 a2d3a3130c965d8f7bfbfa11546bc2ed68973d4eda5f7b1108be5dd552390dbe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ydb_sqlalchemy-0.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9bb63c606af87f76c58da49fd0048b806d04ac97d3be6a3629421f770094138f
MD5 ff2e6d4992729fe5f5359eea9562e2bf
BLAKE2b-256 35b6e8fcc9b8892577249b04f3e832bf98bcf3ace0091183402ea576155dcb0a

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