Skip to main content

duckdbalchemy

Active fork of duckdb_engine (which is unmaintained). SQLAlchemy dialect for DuckDB.

为什么 fork

duckdb_engine 的反射层继承自 PostgreSQL 方言,主键反射查 pg_catalog,对 DuckDB 一律返回空——导致 SQLAlchemy 的 automap 无法生成 ORM 类。上游已停更,故 fork 自维护。

主要改进

  • 主键反射:覆盖 get_pk_constraint / get_multi_pk_constraint,查 DuckDB information_schema,automap_base.prepare() 现在能正常生成 mapped class。
  • 接管 duckdb:// scheme(通过 entry_points),对使用 create_engine("duckdb:///...") 的代码(如 kepler.wind)零改动。
  • 后续:补全外键、唯一约束、索引反射;类型映射优化。

安装

pip uninstall duckdb-engine   # 释放 duckdb:// scheme
pip install -e .

用法

from sqlalchemy import create_engine
e = create_engine("duckdb:///path/to/db.duckdb")  # 自动用本包的 Dialect

Metadata

Release files for duckdbalchemy 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for duckdbalchemy 0.1.0
File Size Uploaded Provenance
duckdbalchemy-0.1.0.tar.gz 13.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for duckdbalchemy 0.1.0
File Interpreter ABI Platform
duckdbalchemy-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.2 kB

Release files / duckdbalchemy-0.1.0.tar.gz

Download URL duckdbalchemy-0.1.0.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c2579760484c4ff0a22c0b4540d8e5993de28e5c9316c8fe29d77c26bd9abf95
BLAKE2b-256 checksum
How to use checksums
aa0d16d35a5eb20a9afa23e9650fa86cacca651d224803e4ce5ebfaa413f32c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / duckdbalchemy-0.1.0-py3-none-any.whl

Download URL duckdbalchemy-0.1.0-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86a579610bc3943aeba73417bf80049801f810e78f132ea43c682167c7c45a85
BLAKE2b-256 checksum
How to use checksums
f14f4cc322c111433ee43d29c31cda269c052b2b6746d6d051c4618d12838374
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Security for duckdbalchemy 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page