---
title: "We're building Postgres in Rust. Using the LLVM of databases"
description: "Turso, a Rust rewrite of SQLite, is adding a Postgres frontend by parsing Postgres SQL into a common AST and compiling it to Turso's VDBE bytecode, turning the engine into an \"LLVM of databases\" with pluggable frontends."
url: "https://swe.quest/articles/we-re-building-postgres-in-rust-using-the-llvm-of-databases-e44d34208278a99e"
canonical: "https://turso.tech/blog/a-new-modern-version-of-postgres-in-rust"
source: "Turso"
published: "2026-07-16"
difficulty: "easy"
kind: "Announcement"
reading_minutes: 11
tags: ["postgres","sqlite","rust","query-engines","open-source"]
---

# We're building Postgres in Rust. Using the LLVM of databases

A post on [Turso](https://swe.quest/sources/turso.md), published 2026-07-16, 11 min read, Announcement. Original: [https://turso.tech/blog/a-new-modern-version-of-postgres-in-rust](https://turso.tech/blog/a-new-modern-version-of-postgres-in-rust)

## Summary

Turso, a Rust rewrite of SQLite, is adding a Postgres frontend by parsing Postgres SQL into a common AST and compiling it to Turso's VDBE bytecode, turning the engine into an "LLVM of databases" with pluggable frontends. The argument is that SQL databases differ mostly in on-disk layout, not in core operations, so Postgres semantics can be expressed in or added to the VDBE. A C-to-VDBE compiler running Doom illustrates that the bytecode works as a real VM. The work starts from the earlier pgmicro experiment and is early-stage but runnable from source. Planned pieces include the Postgres wire protocol, embedded and in-browser use, live materialized views, and WASM-sandboxed extensions, aiming for broad rather than 100% compatibility.

Written by swe.quest, not by the author.

**Difficulty:** Easy: no special background needed; explains what something is and why it matters

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [SQLite](https://swe.quest/tags/sqlite.md) (Data & databases)
- [Rust](https://swe.quest/tags/rust.md) (Languages)
- [Query engines](https://swe.quest/tags/query-engines.md) (Data & databases)
- [Open source](https://swe.quest/tags/open-source.md) (Engineering practices)

## Prerequisites

- SQL database basics ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- PostgreSQL ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- SQLite architecture ([easy posts on SQLite](https://swe.quest/tags/sqlite.md?difficulty=easy))

## Keywords

Turso, PostgreSQL, SQLite, VDBE, pgmicro, WebAssembly, PL/pgSQL, MVCC

## Related posts

- [Running unmodified Doom in the SQLite bytecode language](https://swe.quest/articles/running-unmodified-doom-in-the-sqlite-bytecode-language-75f412e9cb0f0591.md): Turso · 2026-07-17 · Hard · 12 min read · Compilers, SQLite, Runtimes & VMs, Storage engines, C & C++
  Turso compiles unmodified Doom C source to SQLite's VDBE bytecode by using LLVM as a frontend and a custom backend, vdbecc, that lowers LLVM IR to VDBE.
- [Postgres WASM by Snaplet and Supabase](https://swe.quest/articles/postgres-wasm-by-snaplet-and-supabase-a942df855beab1df.md): Supabase · 2022-10-03 · Medium · 9 min read · PostgreSQL, WebAssembly, Virtualization, Browsers, Networking
  postgres-wasm runs a full PostgreSQL 14 server in the browser by emulating an x86 machine with v86 rather than compiling Postgres to WASM directly.
- [Replacing Protobuf with Rust to go 5 times faster](https://swe.quest/articles/replacing-protobuf-with-rust-to-go-5-times-faster-080cb277a22d2431.md): PgDog · 2026-01-22 · Medium · 6 min read · Performance engineering, Rust, PostgreSQL, AI for coding
  PgDog forked pg\_query.rs and replaced libpg\_query's Protobuf serialization layer with direct bindgen-generated C-to-Rust conversions, making SQL parsing 5.45x faster and deparsing 9.64x faster, with a 25% gain in pgbench throughput.
- [How We Built the Turso Shell in the Browser](https://swe.quest/articles/how-we-built-the-turso-shell-in-the-browser-3b4c7642ce66be0b.md): Turso · 2025-10-14 · Medium · 9 min read · WebAssembly, SQLite, React, Frontend, Browsers
  Turso's SQLite-compatible database can run entirely in the browser via WebAssembly, persisting data to OPFS with no backend.
- [How Turso made connections to SQLite databases 575x faster](https://swe.quest/articles/how-turso-made-connections-to-sqlite-databases-575x-faster-271f1e3891c5cf67.md): Turso · 2025-07-29 · Medium · 4 min read · SQLite, Performance engineering, Rust, Concurrency
  SQLite re-reads and parses the sqlite\_schema table on every new connection, so opening a connection to a database with 10,000 tables takes about 23ms.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
