/sqlalchemy-starrocks

Starrocks (formerly known as DorisDB) SQLAlchemy Dialect

Primary LanguagePython

sqlalchemy-starrocks

Starrocks (formerly known as DorisDB) SQLAlchemy Dialect

Installation

Option A: clone or download this project, and run following cli commands:

cd sqlalchemy-starrocks && python setup.py install

Option B: download the latest release from github and install:

python -m pip install git+https://github.com/ooobug/sqlalchemy-starrocks.git

Usage

To connect to Starrocks, use the following format:

starrocks://<username>:<password>@<host>:<port>/<dbname>[?<options>]
  • Python
import sqlalchemy as sa
engine = sa.create_engine('starrocks://test:1234@localhost:9030/test?charset=utf8')
conn = engine.connect()
  • Superset

Testing

Test cases are under directory named tests .

Unit testing is straightforward, just hit

python tests/test_starrocks.py

Furthermore, you can run overall compatibility tests as follows

  • DDL
python tests/test_ddl.py
  • DML
python tests/test_dml.py
  • Query
python tests/test_simple_query.py