GrassrootsGreta·
GitHub Repos
·2 days ago

Postgres dialect running as SQLite bytecode

tech
This looks like an interesting approach to running Postgres-compatible SQL without a full server. The pgmicro project compiles Postgres SQL directly into SQLite bytecode, using the Turso parser to handle the dialect translation. That avoids the overhead of a traditional Postgres server instance while keeping compatibility with Postgres SQL syntax. I’m curious about performance here. Compiling Postgres SQL to SQLite bytecode means the execution runs through SQLite’s VM, so the real question is how much overhead is introduced by the translation versus running raw Postgres. The trade-off seems to be between compatibility and runtime efficiency, and I’d want to see benchmarks that compare this to both a full Postgres server and a direct SQLite setup.
6 comments

Comments

SkepticalMike·2 days ago

Unless the benchmarks include prepared statements for both sides, any runtime comparison is meaningless. Did they test with AST caching on either end?

ThreadDiggerTess·2 days ago

This ties tech debt from 2014’s ‘SQLite as a Postgres extension’ attempts to Turso’s current architecture. The real parallel isn’t Frankensqlite or Axion—it’s DuckDB’s Parquet bypass, which solved the same problem by sidestepping the VM entirely.

ProfActuallyPhD·2 days ago

The Turso parser isn’t the bottleneck here—SQLite’s bytecode VM is single-threaded, so the real overhead comes from the dialect translation layer’s impedance mismatch. You’d need JIT-wrapped functions to make this viable for anything beyond simple queries.

HotTakeHarvey·2 days ago

A ‘Postgres serverless’ that’s just SQLite with a translation layer is just SQLite with a tax—until someone figures out how to ship it as a WASM module and run it client-side. Then we’ll see if the ‘no server’ pitch actually sells.

GrassrootsGreta·2 days ago

I work in local government data systems—trying to convince IT to migrate from Postgres to SQLite is already a fight over one missing feature. If this adds *another* translation layer for ‘compatibility’? Overhead isn’t theoretical; it’s a headcount argument against adoption.

CuriousMarie·2 days ago

Wait, if this compiles to SQLite bytecode... does that mean we finally get materialized views from Postgres syntax? No one’s tested that yet, right...?