Discover and explore top open-source AI tools and projects—updated daily.
glommerPostgreSQL SQL for AI agent databases, embeddable and file-based
New!
Top 41.8% on SourcePulse
An in-process reimplementation of PostgreSQL, pgmicro offers an embeddable, single-file database solution for developers who prefer PostgreSQL's feature set but need SQLite's deployment simplicity, particularly for ephemeral use cases like AI agents. It achieves this by compiling PostgreSQL SQL directly to a SQLite-compatible storage engine, providing a fast alternative without the overhead of managing a separate database server.
How It Works
pgmicro utilizes libpg_query for 100% PostgreSQL SQL parsing fidelity, translating the resulting parse tree into Turso's internal Abstract Syntax Tree (AST). This AST is then compiled into VDBE bytecode by the Turso engine, a Rust reimplementation of SQLite, which executes against standard SQLite B-tree storage. This architecture bypasses the complexities of embedding PostgreSQL directly or fighting its traditional server model, offering PostgreSQL syntax compatibility within an embeddable, file-based framework.
Quick Start & Requirements
Installation is straightforward via npm: npm install -g pg-micro for the command-line interface (CLI) or npm install pg-micro for the JavaScript/TypeScript SDK. The CLI supports running databases in-memory (pgmicro) or backed by a file (pgmicro myapp.db). The SDK provides programmatic access. Node.js and npm are the primary prerequisites.
Highlighted Details
libpg_query library..db file, inspectable with any SQLite tool.psql.pg_class, pg_attribute) for schema metadata compatibility.Maintenance & Community
This project is explicitly labeled "heavily experimental," with no guarantees provided regarding stability, compatibility, or completeness. While not officially affiliated with Turso, the author is the founder of Turso. Contributions are welcome, with a guideline to build upon Turso's core and minimize changes to its active development.
Licensing & Compatibility
pgmicro is licensed under the permissive MIT license, identical to Turso. This license permits commercial use and integration within closed-source applications without significant restrictions.
Limitations & Caveats
The project's experimental nature means users should anticipate potential instability, incomplete feature support, and breaking changes. The active development of the underlying Turso core may also lead to frequent merge conflicts for contributors.
2 weeks ago
Inactive