Registry / database / databend-driver

databend-driver

JSON →
library0.34.0pypypi✓ verified 85d ago

Official Python driver for Databend, providing a DB-API 2.0 interface and async SQL execution. Current version 0.33.7, requires Python >=3.8 and <3.14. Released roughly weekly via bendsql monorepo.

pip install databend-driver
INSTALL
IMPORT
SIG · DATABEND-DRIVER
D
databend-driver
databasepythonv0.34.0
Install
1.9s avg
Import
42ms
Disk
40MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.34.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.9s · import 0.042s · 43MB
40MB installed
● package 40MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

connect
from databend_driver import connect
connect is a top-level function; no need to import DatabendDriver directly.
BlockingDatabendDriver
from databend_driver import BlockingDatabendDriver
from databend_driver import DatabendDriver
DatabendDriver is the async driver class; the sync driver is BlockingDatabendDriver.
AsyncDatabendDriver
from databend_driver import AsyncDatabendDriver
from databend_driver import DatabendDriver
AsyncDatabendDriver is the async driver class; DatabendDriver does not exist in recent versions.

Connect to Databend using a DSN string and execute a synchronous query.

import os from databend_driver import BlockingConnector dsn = os.environ.get('DATABEND_DSN', 'databend://user:password@host:443/database') conn = BlockingConnector(dsn).connect() result = conn.query('SELECT version()') print(result) conn.close()
Debug
Known issues
breakingIn 0.31.0, the internal DataType 'TimestampTz' was added, changing how timestamps with timezone are returned. Code relying on previous behavior may break.
fix
Ensure your application handles Datetime objects for timestamp columns with timezone.
affects: >=0.31.0
gotchaThe async driver and sync driver have different method signatures. AsyncDriver uses await, while BlockingDriver uses blocking calls. Mixing them leads to runtime errors.
fix
Use BlockingConnector for synchronous code and AsyncConnector for async code. Do not mix.
affects: all
deprecatedThe 'body_format' option was renamed to 'result_format' in 0.33.1. Using the old name may be silently ignored or cause errors.
fix
Replace any use of 'body_format' in DSN options with 'result_format'.
affects: >=0.33.1
Errors
Common errors & fixes
ImportError: cannot import name 'DatabendDriver' from 'databend_driver'
The class is now named AsyncDatabendDriver or BlockingDatabendDriver; DatabendDriver was removed.
fix
Use 'from databend_driver import AsyncDatabendDriver' or 'from databend_driver import BlockingDatabendDriver'.
TypeError: 'NoneType' object is not callable
Attempting to use await on a blocking driver method, or calling connect() on an uninitialized connector.
fix
Ensure you use BlockingConnector for sync, AsyncConnector for async, and call the correct methods (e.g., await conn.query() for async).
ValueError: Unsupported DSN scheme
DSN must start with 'databend://' or 'databend+http://' prefix. Missing or wrong scheme.
fix
Use DSN format: databend://user:password@host:port/database
Upgrade
Version history
0.34.0latest on PyPI · released May 18, 2026
Audit
Dependencies
pyarrowoptionalUsed for columnar data transfer and Arrow IPC format
Agent activity
11 hits · last 30 days
node
8
Resources
databend-driver — pip install databend-driver · libregistry