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}?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


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 details)

Uploaded Source

Built Distribution

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

databend_sqlalchemy-0.4.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: databend_sqlalchemy-0.4.0.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for databend_sqlalchemy-0.4.0.tar.gz
Algorithm Hash digest
SHA256 19c1b14a8d124ef917299b0dcbd31a7d47d539a143d028e4300a2e426b906408
MD5 a6db02bbcc1efc62560b01a394339933
BLAKE2b-256 d715d6d5ab71ec2264e2ceaa3417332f84c0d83eebc62eb21f994c3eb278a692

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for databend_sqlalchemy-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c53229e32df5dd80ee25e797e9279ce409b4e353fecef25b5cca3d9680f814cd
MD5 544855bbd21f2eb2b83881713d1643ae
BLAKE2b-256 f5a3061ec83685a6db1c789efea9eb5385da61f6f91659830dd204b18cf44c0a

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