DuckDB HTTP dialect for SQLAlchemy
Project description
DuckDB HTTP SQLAlchemy Plugin
A lightweight SQLAlchemy dialect/plugin for connecting to DuckDB, on top of httpserver duckdb extension. Works with Superset for visualization.
Features
- Connect to DuckDB via SQLAlchemy.
- Support multiple connection read/write.
- Support auth:
- Basic auth : duckdb_http://alice:secret@localhost:9999
- API key: duckdb_http://localhost:9999?api_key=SECRETKEY
- Read only mode: add ?read_only=true
Installation
pip install duckdb_http
Usage
1. Connect to DuckDB
from sqlalchemy import create_engine, text
# Connect to local DuckDB database
engine = create_engine("duckdb_http://user:pass@localhost:9999")
# engine = create_engine("duckdb_http://localhost:9999?api_key=secretkey")
with engine.connect() as conn:
# Execute queries using SQLAlchemy text()
result = conn.execute(text("SELECT 1"))
print(result.fetchone())
Notes
- Always wrap raw SQL with
text()when using SQLAlchemy 2.x. - Compatible with Superset: once installed, you can select DuckDB as a database backend.
- Supports multiple schemas and introspection.
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
duckdb_http-0.1.3.tar.gz
(5.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file duckdb_http-0.1.3.tar.gz.
File metadata
- Download URL: duckdb_http-0.1.3.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50964a7168350ca66f2445721cbd5a14181fd8da471cab7ab6ce0d80c5bc2421
|
|
| MD5 |
e4553639e4d30395f7bd0e8007ebb33a
|
|
| BLAKE2b-256 |
7692073e3a3557e38776e62c11577ce71124b52d9f48999234ea617a1e0c51bd
|
File details
Details for the file duckdb_http-0.1.3-py3-none-any.whl.
File metadata
- Download URL: duckdb_http-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4281505ff6d32550c01f746cc800cdfdbd284f8f9b62292151dbf9aa9ff0a44d
|
|
| MD5 |
cbb82780df1431af478e5c7fd62df3df
|
|
| BLAKE2b-256 |
818e46e22378dd4ad22102b73e790f88b85ca43c3d8db836b9616fab5bcdc63d
|