Skip to main content

Databend dialect for SQLAlchemy

Project description

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}?secure=false"
)
connection = engine.connect()
result = connection.execute(text("SELECT 1"))
assert len(result.fetchall()) == 1

import connector
cursor = connector.connect('http://root:@localhost:8081').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


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.3.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

databend_sqlalchemy-0.3.0-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file databend-sqlalchemy-0.3.0.tar.gz.

File metadata

  • Download URL: databend-sqlalchemy-0.3.0.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for databend-sqlalchemy-0.3.0.tar.gz
Algorithm Hash digest
SHA256 008ea8ebd57b3e68132d36bcf96c5f1684a28a7cf568ca7ff0eb534babfaf2a5
MD5 8d6e1f1c94c89178823e4e670593a760
BLAKE2b-256 1e56ef6d8cc870a06e4a672591631396bf8317d97633d2abcb5ca0c5aa49f8bb

See more details on using hashes here.

File details

Details for the file databend_sqlalchemy-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for databend_sqlalchemy-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c80676872682626dd29a70a9b73ca377e8b940fd0c3b0777590529da15d20a4e
MD5 0b8f12e9d7269fda377f5ed384661d39
BLAKE2b-256 546f4976861582cac7d2939d9dd3724c2d10eae7c2c85a72689ff928ee035926

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page