Sqlalchemy adapter for Databend
Project description
databend-sqlalchemy
Databend dialect for SQLAlchemy.
Installation
The package is installable through PIP::
pip install databend-sqlalchemy
Usage
The DSN format is similar to that of regular Postgres::
from sqlalchemy import create_engine, text
from sqlalchemy.engine.base import Connection, Engine
engine = create_engine(
f"databend://{username}:{password}@{host_port_name}/{database_name}?sslmode=disable"
)
connection = engine.connect()
result = connection.execute(text("SELECT 1"))
assert len(result.fetchall()) == 1
import connector
cursor = connector.connect('databend://root:@localhost:8000?sslmode=disable').cursor()
cursor.execute('SELECT * FROM test')
# print(cursor.fetchone())
# print(cursor.fetchall())
for i in cursor.next():
print(i)
Compatibility
If databend version >= v0.9.0 or later, you need to use databend-sqlalchemy version >= v0.1.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
databend_sqlalchemy-0.4.2.tar.gz
(16.2 kB
view hashes)
Built Distribution
Close
Hashes for databend_sqlalchemy-0.4.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f886f0a5d227083be8727b6a6dc48b69e7cb2b4218724287a8f4c3e5080d268 |
|
MD5 | 0ef948e4a664d320f31b26eb6c2a2c8c |
|
BLAKE2b-256 | 4819d60cf4ffec41b32d7e013860c26d0b50677132be73bac5be16d6aef8a883 |
Close
Hashes for databend_sqlalchemy-0.4.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8bc62ebd24920a6a511dbf20a9b01cff799d3d31f4206e144a4fffdf6bd8748 |
|
MD5 | 104954fe6de512aa776111d60e05875d |
|
BLAKE2b-256 | bb8097c6dd4f5c8e468b1f99ee330a1dfe2292cb4b901ae91dfbc24ae65c184e |