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.1.tar.gz
(16.2 kB
view hashes)
Built Distribution
Close
Hashes for databend_sqlalchemy-0.4.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49dfd438eaa2741ff84cc1621a35cebd2d2b0f9b6759e3a72849e13a62e7f720 |
|
MD5 | 440a88aa19bfaaa4139e2861cb5a9412 |
|
BLAKE2b-256 | 4ada19b66b62369cb8a0a87354ffa2ac66f795c430326982cf9d50c37105e5e5 |
Close
Hashes for databend_sqlalchemy-0.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 767b6b54f636f81e7b84868436ba70da1c7e4dfd2ea1498d6a8689b8229c387d |
|
MD5 | ccc59eedeb4ad6e96992758a8f426194 |
|
BLAKE2b-256 | bb0ff969bd405001667c200a7450ddfb42c7577bc4f31d9aa8f953fa20e74ed4 |