---
title: "alchemy-utils 0.1a0 发布：基于 SQLAlchemy 的多数据库工具库"
source: "Simon Willison 博客（Atom）"
source_tier: "t2"
url: "https://simonwillison.net/2026/Aug/12/alchemy-utils/"
permalink: "https://feed.astralor.com/items/itm_e48e65b70f34db226e7e1dc9"
published: "2026-08-12T19:51:30.000Z"
score: 73
channel: "tech"
tags: ["AI 编码代理","alchemy-utils","Codex","SQLAlchemy","sqlite-utils"]
---

# alchemy-utils 0.1a0 发布：基于 SQLAlchemy 的多数据库工具库

## AI 点评

> 这个项目最值得关注的地方在于，它把 sqlite-utils 的易用性扩展到了 Postgres 和 DuckDB，听起来正是很多人想要的东西。而且整个开发过程几乎由 AI 代劳，这或许预示着开源工具的开发模式正在改变。如果你是 Python 数据开发者，值得去试一下；但 alpha 版本还需谨慎，毕竟 SQLite 和 PostgreSQL 的行为差异不小。

## 速览

Simon Willison 发布了 alchemy-utils 0.1a0，一个基于 SQLAlchemy 的多数据库工具库，其核心 API 与他的 sqlite-utils 保持一致，支持 insert、upsert、create 等操作，并可在 PostgreSQL、SQLite 和 DuckDB 上运行。该原型由 AI 编码代理 Codex 和 GPT-5.6 Sol Ultra 在极短时间内生成，作者通过少量提示就完成了从想法到 alpha 版本的过程。项目还提供 CLI 工具，可通过 uvx 直接使用，例如快速将 CSV 导入 DuckDB。

## 关键点

- alchemy-utils 0.1a0 发布，基于 SQLAlchemy 实现多数据库支持。
- 核心 API 与 sqlite-utils 保持一致，包括 insert、upsert、create 等。
- 支持 PostgreSQL、SQLite 和 DuckDB，并可通过 uvx CLI 直接使用。
- 由 AI 编码代理 Codex 和 GPT-5.6 Sol Ultra 辅助开发，从想法到 alpha 仅用少量提示。

## 全文

Release: alchemy-utils 0.1a0 I've long pondered what a database agnostic version of my sqlite-utils Python library and CLI utility might look like. This morning (literally a shower project) I tasked Codex and GPT-5.6 Sol Ultra with building a prototype: Do a research spike to see what it would take to build a library with the same core API as SQLite-utils - in particular the insert and upsert and insert_all and upsert_all and create and update methods, and the table introspection stuff - but backed by SQLalchemy so it works for multiple database engines Test against PostgreSQL and SQLite and duckdb Use ~/dev/sqlite-utils for reference Create a git repo for this and commit and early and often - use uv init to start the project - use red/green TDD and pytest, see ~/dev/django-sql-dashboard for one idea as to how the PostgreSQL tests could work It took very few follow-up prompts to produce this project in a state good enough to release as an alpha. Here's a one-liner I can use to list the rows in a table in my local PostgreSQL copy of my blog's database: uvx --with 'alchemy-utils[postgresql]' alchemy-utils rows 'postgresql+psycopg://simon@localhost:5432/simonwillisonblog' redirects_redirect The output from that starts like this: [ { "id": 2328, "domain": "simonwillison.net", "path": "2020/May/21/apple-photos-sqlite/", "target": "/2020/May/21/dogsheep-photos/", "created": "2020-05-21T13:03:46.591692-07:00" }, { "id": 3, "domain": "feeds.simonwillison.net", "path": "swn-links", "target": "https://simonwillison.net/atom/links/", "created": "2017-10-01T14:12:54.820729-07:00" } Or if you'd like a DuckDB database with every tree in San Francisco, schema created automatically to match the file: curl 'https://raw.githubusercontent.com/simonw/sf-tree-history/refs/heads/main/Street_Tree_List.csv' | uvx --with 'alchemy-utils[duckdb]' alchemy-utils insert 'duckdb:////tmp/trees.db' trees - --csv (That one took nearly an hour the first time I ran it, so I had Codex optimize it and got it down to around 35 seconds.) Tags: databases, postgresql, projects, python, sql, sqlalchemy, sqlite, sqlite-utils, duckdb, coding-agents, codex

---

引用前请核对原文;本文由星际流动整理:https://feed.astralor.com/items/itm_e48e65b70f34db226e7e1dc9
