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.0.tar.gz
(16.0 kB
view hashes)
Built Distribution
Close
Hashes for databend_sqlalchemy-0.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19c1b14a8d124ef917299b0dcbd31a7d47d539a143d028e4300a2e426b906408 |
|
MD5 | a6db02bbcc1efc62560b01a394339933 |
|
BLAKE2b-256 | d715d6d5ab71ec2264e2ceaa3417332f84c0d83eebc62eb21f994c3eb278a692 |
Close
Hashes for databend_sqlalchemy-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c53229e32df5dd80ee25e797e9279ce409b4e353fecef25b5cca3d9680f814cd |
|
MD5 | 544855bbd21f2eb2b83881713d1643ae |
|
BLAKE2b-256 | f5a3061ec83685a6db1c789efea9eb5385da61f6f91659830dd204b18cf44c0a |