Skip to main content

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}?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.1.tar.gz (16.9 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.1-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file databend_sqlalchemy-0.3.1.tar.gz.

File metadata

  • Download URL: databend_sqlalchemy-0.3.1.tar.gz
  • Upload date:
  • Size: 16.9 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.1.tar.gz
Algorithm Hash digest
SHA256 949c3f1c31a56597b9300be0291e6e3d41cf38b9701a1a9d5dc2154ffbb19f73
MD5 b2ae08fe7bc12522fb35d776ed220f58
BLAKE2b-256 0da9ba1c8551276825e6346bd755634e958f77b016bdad06113cb26c692a1b96

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for databend_sqlalchemy-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f886fdbaa5281deda6d6bdcd02ea5847be04b9e85d5db89af934d727ef22b485
MD5 a3d1d1315c962b7a8e8bd9469a7b33b9
BLAKE2b-256 c1f146d863069577afd639b39789b34f6630034e5d0133e14773631db434e440

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