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.1.tar.gz
(2.1 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.1.tar.gz.
File metadata
- Download URL: duckdb_http-0.1.1.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfe6704ccfb47da6795cd326d2db1c0d0628294ee0dda29fb9b39bf3a7b08539
|
|
| MD5 |
e8b7acb921632d2c16a46941499d2010
|
|
| BLAKE2b-256 |
441396055ced84d6c7c0cda222bfae4bb11bb83fa1748b7a6a54e0e2a983d830
|
File details
Details for the file duckdb_http-0.1.1-py3-none-any.whl.
File metadata
- Download URL: duckdb_http-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.0 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 |
bdc3beba8450b42bbf2411d62985b1f91eb7369d11a380812e0969f37a0279b5
|
|
| MD5 |
361609908a021517221b4e55b53f7863
|
|
| BLAKE2b-256 |
b5c3befa5786465c05c4cda12f1def5111061c641705acfede2a2586a461021c
|