Skip to main content

Python driver with native interface for Databend

Project description

databend-py

Databend Cloud Python Driver with native http interface support

https://img.shields.io/pypi/v/databend-driver.svg https://coveralls.io/repos/github/databendcloud/databend-py/badge.svg?branch=master https://img.shields.io/pypi/l/databend-driver.svg https://img.shields.io/pypi/pyversions/databend-driver.svg

Installation

pip install databend-py

Usage

Use the next code to check connection:

>>> from databend_py import Client
>>> client = Client(
    host='tenant--warehouse.ch.datafusecloud.com',
    database="default",
    user="user",
    password="password")
>>> print(client.execute("SELECT 1"))

The host, user, password info will be found in databend cloud warehouse connect page as flows:

Pure Client example:

>>> from databend_pyimport Client
>>>
>>> client = Client('http://root:rootlocalhost:8081/db')
>>>
>>> client.execute('SHOW TABLES')
[('test',)]
>>> client.execute('DROP TABLE IF EXISTS test')
[]
>>> client.execute('CREATE TABLE test (x Int32)')
[]
>>> client.execute(
...     'INSERT INTO test (x) VALUES', [(1,)]
... )
1
>>> client.execute('INSERT INTO test (x) VALUES', [(200,)])
1

Features

  • Basic SQL.

  • TLS support.

  • Query settings.

  • Types support:

    • Float32/64

    • [U]Int8/16/32/64/128/256

    • Date/Date32/DateTime(‘timezone’)/DateTime64(‘timezone’)

    • String

    • Array(T)

    • Nullable(T)

    • Bool

Documentation

// TODO

License

Databend Python Driver is distributed under the Apache license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

databend_py-0.2.7-py3-none-any.whl (16.1 kB view hashes)

Uploaded Python 3

Supported by

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