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
git clone https://github.com/oraichain/duckdb-http.git
Then, install this plugin (if packaged locally):
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.tar.gz
(1.8 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.tar.gz.
File metadata
- Download URL: duckdb_http-0.1.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
504abdc04f2d5f8f92b4180b0519dd7b545963f389338fcafce4ef09667abb8c
|
|
| MD5 |
7c1534d0f21224df6c0bd26c7f0dd00f
|
|
| BLAKE2b-256 |
2c9e8e3003427bc079e32aadb75a2c3c2550a2644417d16dbd2c8cad90ea59eb
|
File details
Details for the file duckdb_http-0.1-py3-none-any.whl.
File metadata
- Download URL: duckdb_http-0.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 |
d7d6921922a5470a4f17f22848c4ede0288f944496d777b1c3544dd393a32cbe
|
|
| MD5 |
55517fbabbcf85411dbd58edd5179a38
|
|
| BLAKE2b-256 |
2bae1edb413b27486217f42a823e69e1e234376ef672129617980f49617e8f6f
|