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.3.tar.gz
(16.1 kB
view hashes)
Built Distribution
Close
Hashes for databend_sqlalchemy-0.4.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3ee710f58673057d0cbe984b07b84676131932b6a5b01c1fa60aa123fbb6a20 |
|
MD5 | b34fe47b5260de7334542ab1613eb2a1 |
|
BLAKE2b-256 | 19ca09129b363946839d89d20c29e4dd15e125a65180b75d36a5e0887d222819 |
Close
Hashes for databend_sqlalchemy-0.4.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9061368214a8fcb5d1090ea115ec3486df2ea24c426034b58ba16235ff586548 |
|
MD5 | 5a7fbbab65108c930b7845b3ff709263 |
|
BLAKE2b-256 | 7fa9c17a37c26e6ba7027032befed1c1f8aee4fdf899b3ad4a06702cf853fa5f |