GitHub - pingcap/sqlalchemy-tidb (original) (raw)

sqlalchemy-tidb

.github/workflows/ci.yml

This adds compatibility for TiDB to SQLAlchemy.

Supported versions

Installation

pip install git+https://github.com/pingcap/sqlalchemy-tidb.git@main

Getting Started

In your Python app, you can connect to the database via:

from sqlalchemy import create_engine engine = create_engine("tidb://username:password@ip:port/database_name?charset=utf8mb4")

Known issues

Testing this dialect with SQLAlchemy and Alembic

Bootstrap your environment with virtualenv and requirements installed

You can run the tests using the following command:

make all

Or running test with tox for a specified python version

tox -e py39

Or running test directly using pytest

pytest "test/test_suite.py::DateTest"

To know more about developing the TiDB dialect, checkout the guide on sqlalchemy: