Databend Driver Python Binding
Project description
databend-driver
Build
cd bindings/python
maturin develop
Usage
import asyncio
from databend_driver import AsyncDatabendClient
async def main():
client = AsyncDatabendClient('databend+http://root:root@localhost:8000/?sslmode=disable')
conn = await client.get_conn()
await conn.exec(
"""
CREATE TABLE test (
i64 Int64,
u64 UInt64,
f64 Float64,
s String,
s2 String,
d Date,
t DateTime
)
"""
)
rows = await conn.query_iter("SELECT * FROM test")
async for row in rows:
print(row.values())
asyncio.run(main())
APIs
AsyncDatabendClient
class AsyncDatabendClient:
def __init__(self, dsn: str): ...
async def get_conn(self) -> AsyncDatabendConnection: ...
AsyncDatabendConnection
class AsyncDatabendConnection:
async def info(self) -> ConnectionInfo: ...
async def version(self) -> str: ...
async def exec(self, sql: str) -> int: ...
async def query_row(self, sql: str) -> Row: ...
async def query_iter(self, sql: str) -> RowIterator: ...
async def stream_load(self, sql: str, data: list[list[str]]) -> ServerStats: ...
Row
class Row:
def values(self) -> tuple: ...
RowIterator
class RowIterator:
def __aiter__(self) -> RowIterator: ...
async def __anext__(self) -> Row: ...
def schema(self) -> Schema: ...
Field
class Field:
@property
def name(self) -> str: ...
@property
def data_type(self) -> str: ...
Schema
class Schema:
def fields(self) -> list[Field]: ...
ServerStats
class ServerStats:
@property
def total_rows(self) -> int: ...
@property
def total_bytes(self) -> int: ...
@property
def read_rows(self) -> int: ...
@property
def read_bytes(self) -> int: ...
@property
def write_rows(self) -> int: ...
@property
def write_bytes(self) -> int: ...
@property
def running_time_ms(self) -> float: ...
ConnectionInfo
class ConnectionInfo:
@property
def handler(self) -> str: ...
@property
def host(self) -> str: ...
@property
def port(self) -> int: ...
@property
def user(self) -> str: ...
@property
def database(self) -> str | None: ...
@property
def warehouse(self) -> str | None: ...
Development
pipenv install --dev
maturin develop
pipenv run behave tests
Project details
Release history Release notifications | RSS feed
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 Distributions
Close
Hashes for databend_driver-0.11.1-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8937f5cdb6abd0b865de169f54dabeebc2260016663e99d1a6e7369d6f7e6fd |
|
MD5 | bf75e56bef5f0c8eba92942a149ee459 |
|
BLAKE2b-256 | eeab6840eb71912111ec8a4bc216f1871d22a98a4950931ca45a7e2ddec68139 |
Close
Hashes for databend_driver-0.11.1-cp37-abi3-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e55d10839ec7ca0a89bae46b7866f5a2ef857b7caefb53a249d3015b0a4d5501 |
|
MD5 | 9415b65c4ea7278a3b56d99703a0eaf6 |
|
BLAKE2b-256 | eaddbb13ea55bf366c56e9d29af3310e6d2fb72e361ab7314788a9b627d85ae2 |
Close
Hashes for databend_driver-0.11.1-cp37-abi3-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3269dc62de69c6e7cd82d86785c0fb0de28a0bdeacb81142984224b7d5591c47 |
|
MD5 | e3159e564cd6d661e4661f4bc2c8467e |
|
BLAKE2b-256 | ce0e6b2e28f7f1c4cc201c3dc4180acdabc90994708ff296c558586c59c22334 |
Close
Hashes for databend_driver-0.11.1-cp37-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 685c1cd811310a5a89baa2c12d7c3a79a491056b83fd5fbe52fc7b7bf15989e9 |
|
MD5 | 3ebaa8f800067d3f76fef2498cbbdc30 |
|
BLAKE2b-256 | a3efe0323ef1636413d2b7dd8c274b0833b12ff34fca2d3a5c19966460aca8b0 |
Close
Hashes for databend_driver-0.11.1-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8d1960832614e2630bd4b696e9bdc8989fbb1dfdf5ec525967ad5c1c9124a61 |
|
MD5 | d383ea776d36b5940949109b5c511e09 |
|
BLAKE2b-256 | 4a1c0100c8b3b4d7e0a2dbd8dcab59b238090c6f276e8905ccec214f8b42a15c |