Skip to main content

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.2.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

duckdb_http-0.1.2-py3-none-any.whl (2.0 kB view details)

Uploaded Python 3

File details

Details for the file duckdb_http-0.1.2.tar.gz.

File metadata

  • Download URL: duckdb_http-0.1.2.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for duckdb_http-0.1.2.tar.gz
Algorithm Hash digest
SHA256 844dc865d3113b700c54b02461c097e327dd8ee7f22cae636445d9ce7ccf6571
MD5 f825668fec205c82cb00da88c59f7456
BLAKE2b-256 f79ffd245f5b41a8669e634e9599dc3fa8c1981a293bb79f6e27b0456e6f9e44

See more details on using hashes here.

File details

Details for the file duckdb_http-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: duckdb_http-0.1.2-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

Hashes for duckdb_http-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cee1a24ff181bfb2c947dda863c32ad44839f2d851979c7216790895dce49969
MD5 a4c9928ebceb899bd0e82a66e7ff9ced
BLAKE2b-256 f2727f2d9ee79be4159d4c36ae75bee224fb84168ff363ef90eef35f1d712e87

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page