---
title: "alchemy-utils 0.1a0: A SQLAlchemy-Backed Multi-Database Toolkit"
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 coding agents","alchemy-utils","Codex","SQLAlchemy","sqlite-utils"]
---

# alchemy-utils 0.1a0: A SQLAlchemy-Backed Multi-Database Toolkit

## AI commentary

> The most interesting aspect of this project is that it brings the usability of sqlite-utils to Postgres and DuckDB—something many developers have likely wanted. And since the entire development process was largely AI-driven, it hints at a shift in how open-source tools might be built. If you're a Python data developer, it's worth trying out; but as an alpha release, be cautious—SQLite and PostgreSQL behavior differ significantly.

## At a glance

Simon Willison has released alchemy-utils 0.1a0, a database-agnostic Python library and CLI utility built on SQLAlchemy. Its core API mirrors sqlite-utils, including insert, upsert, create, and table introspection methods, but works across multiple database engines. The prototype was created with AI coding agents Codex and GPT-5.6 Sol Ultra in a remarkably short time—Willison described it as a 'shower project' that took very few follow-up prompts to reach an alpha release. It currently supports PostgreSQL, SQLite, and DuckDB, and includes a uvx-based CLI for tasks like listing rows from a Postgres table or importing CSV data into DuckDB. The project also demonstrates how AI agents can accelerate tool development, with performance optimizations cutting a DuckDB import from nearly an hour down to about 35 seconds.

## Key points

- Released alchemy-utils 0.1a0, a SQLAlchemy-backed library that provides a database-agnostic version of sqlite-utils.
- Core API mirrors sqlite-utils: insert, upsert, insert_all, upsert_all, create, update, and table introspection.
- Works with PostgreSQL, SQLite, and DuckDB; includes a uvx CLI for quick operations.
- Built with AI coding agents Codex and GPT-5.6 Sol Ultra; achieved alpha quality with very few prompts.

## Full text

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

---

Verify against the original before citing; curated by Astral Feed: https://feed.astralor.com/items/itm_e48e65b70f34db226e7e1dc9
