Simon Willison、AI でデータベース非依存ライブラリ「alchemy-utils 0.1a0」
本文の状態
日本語全文を表示中
詳細モードで約2分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
Simon Willison Blog
Simon Willison は Codex と GPT-5.6 Sol Ultra に具体的なプロンプトを与え、数回のフォローアップで SQLite-utils の機能を持つデータベース非依存ライブラリのプロトタイプを生成させた。
Continue in AI NEW LAB
このニュースを、実務の判断につなげる
AI NEW LABで、試したことや先に確認したい条件を共有できます。まずはログインなしで読めます。
AI NEW LABで論点を見るAI深層分析を開く2026年8月13日 13:05
AI深層分析
キーポイント
AI エージェントによる自動開発の実証
Simon Willison は Codex と GPT-5.6 Sol Ultra に具体的なプロンプトを与え、数回のフォローアップで SQLite-utils の機能を持つデータベース非依存ライブラリのプロトタイプを生成させた。
多様なデータベースエンジンへの対応
同ライブラリは SQLAlchemy をバックエンドに採用し、PostgreSQL、SQLite、DuckDB などの複数のデータベースエンジンで動作するよう設計されている。
CLI ツールとしての実用性
uvx コマンドを利用したワンライナーでテーブルの列挙や CSV データの挿入が可能であり、大規模データ処理においても最適化により高速化が図られている。
開発プロセスとテスト戦略
プロジェクトは uv init で初期化され、red/green TDD と pytest を採用して PostgreSQL と SQLite でのテストが行われた。
重要な引用
I've long pondered what a database agnostic version of my sqlite-utils Python library and CLI utility might look like.
It took very few follow-up prompts to produce this project in a state good enough to release as an alpha.
(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.)
編集コメントを表示
編集コメント
Simon Willison は自身のプロジェクトを AI エージェントに任せることで、数時間で実用レベルのツールを開発した。これは単なる実験ではなく、実際のデータ処理タスクで即座に使用可能な成果物であり、AI による開発支援の実効性を如実に示している。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
リリース: alchemy-utils 0.1a0
私は長年、私の Python ライブラリおよび CLI ツールである sqlite-utils のデータベース非依存版がどのようなものになるかについて考えてきました。今朝(まさにシャワー中に思いついたプロジェクトです)、Codex と GPT-5.6 Sol Ultra にプロトタイプの構築を依頼しました。
sqlite-utils と同じコア API を持つライブラリを作るにはどうすればよいか、調査してください。具体的には insert や upsert、insert_all や upsert_all、create や update メソッド、そしてテーブルのインテロゲーション機能などです。ただし、SQLalchemy をバックエンドとして使用し、複数のデータベースエンジンで動作するようにしますPostgreSQL、SQLite、DuckDB でテストしてください~/dev/sqlite-utils をリファレンスとして使ってくださいこのプロジェクト用の Git リポジトリを作成し、頻繁にコミットしてください。uv init を使ってプロジェクトを開始し、赤/緑の TDD と pytest を使用します。PostgreSQL のテストの実装方法については、~/dev/django-sql-dashboard を参考にしてください
非常に少ない数の追加プロンプトで、このプロジェクトはアルファ版としてリリースできる状態にまで完成しました。
私のブログのデータベースをローカルの PostgreSQL にコピーした際、テーブル内の行を一覧表示するために使えるワンライナーがこれです:
uvx --with 'alchemy-utils[postgresql]' alchemy-utils rows 'postgresql+psycopg://simon@localhost:5432/simonwillisonblog' redirects_redirect
その出力は以下のように始まります:
[
{
"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"
}
サンフランシスコの全木を収録した DuckDB データベースを、ファイルの構造に合わせて自動でスキーマを作成して用意したい場合は、以下のコマンドを実行します。
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
この処理は、私が初めて実行した際は約 1 時間かかりました。そこで Codex に最適化を依頼 したところ、実行時間を約 35 秒に短縮できました。
Tags: databases, postgresql, projects, python, sql, sqlalchemy, sqlite, sqlite-utils, duckdb, coding-agents, codex
原文を表示
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
関連記事
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み