pgmicro
An in-process reimplementation of PostgreSQL, backed by a SQLite-compatible storage engine.
pgmicro is built as an experimental fork of Turso — a full from-scratch rewrite of SQLite in Rust — with PostgreSQL added as a native dialect. The result is a fast, embeddable, single-file database that speaks PostgreSQL.
Why?
AI agents are driving an explosion of databases. Many of them are ephemeral, low-touch, short-lived, and small — a scratch database for a task, a session store that lives for minutes, a per-user sandbox.
SQLite has traditionally been king in these environments, and it’s easy to see why: it’s just a file (or even in-memory), no server to manage, no ports to configure. But many developers prefer PostgreSQL — whether out of familiarity, taste, or because PostgreSQL is legitimately more powerful in areas like its type system, JSON operators, and query capabilities.
Other approaches to bring PostgreSQL in-process try to compile PostgreSQL itself to WebAssembly. But PostgreSQL’s architecture — particularly its process-per-connection model, shared memory assumptions, and reliance on a full OS environment — makes this fundamentally constrained. You end up fighting the architecture rather than benefiting from it.
pgmicro takes a different path entirely.
How is pgmicro different?
pgmicro does not translate PostgreSQL to SQLite syntax. It does not embed or compile PostgreSQL. Instead, it parses the PostgreSQL language and compiles it directly to SQLite bytecode.
Here’s how it works:
pgmicro architecture
====================