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

Uploaded Source

Built Distribution

ydb_sqlalchemy-0.0.1b19-py2.py3-none-any.whl (41.2 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for ydb_sqlalchemy-0.0.1b19.tar.gz
Algorithm Hash digest
SHA256 f722a39952169f5e4f144bd091493287a738420ff5cfcb3e5059f95f36698639
MD5 9114e345818f08026f1575ac518bfae8
BLAKE2b-256 554882440648f9e5a92365f92beee74a6b279c867dbf4c3503fad6a4dda5f247

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ydb_sqlalchemy-0.0.1b19-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 57f351d20e4eba803fb309c17de4301655c550f0803b5e3aba4ae8222c6d25a5
MD5 c53d78a76eee8e95b5d947ad2673589b
BLAKE2b-256 c0a79e66bc0f2177f6687a9f2179b890fe909253c0bdd3fad3088e119c14fa71

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