Metadata-Version: 2.1
Name: databend-sqlalchemy
Version: 0.3.0
Summary: Databend dialect for SQLAlchemy
License: Apache-2.0
Project-URL: Repository, https://github.com/datafuselabs/databend-sqlalchemy
Project-URL: Homepage, https://databend.rs
Keywords: databend,db,database,cloud,analytics,SQLAlchemy
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: SQL
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Database
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: <4,>=3.7
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: databend-driver
Requires-Dist: sqlalchemy <2.0,>1.3.21
Provides-Extra: lint
Requires-Dist: black ; extra == 'lint'
Requires-Dist: flake8 ; extra == 'lint'
Provides-Extra: superset
Requires-Dist: apache-superset >=1.4.1 ; extra == 'superset'
Provides-Extra: test
Requires-Dist: pytest ; extra == 'test'

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.
