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

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

Details for the file ydb-sqlalchemy-0.0.1b9.tar.gz.

File metadata

  • Download URL: ydb-sqlalchemy-0.0.1b9.tar.gz
  • Upload date:
  • Size: 31.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for ydb-sqlalchemy-0.0.1b9.tar.gz
Algorithm Hash digest
SHA256 47e341ede421582c4a85a7216e967ff84b57c2b8643e10cac2541c4e04cfa8f6
MD5 20dce6cd71309f9879e7a6d3408806b7
BLAKE2b-256 4e4c52555526f923fcab8dbd3230b93d0cdb7f79fecd4fd4171d50e3c55d9db7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ydb_sqlalchemy-0.0.1b9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 633a62722405260b8451c5491d7fd39e3f43e86a92c35ef28b371ecc47cad3a5
MD5 f6ef9085bf208eed2b0f2162b418f6ea
BLAKE2b-256 e74bc29ae2863deef4d45c77fb1a298f5db9a24d566e0335f43e78c694ebc47f

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