Files
Sebastien Tardif f3309d06f4 postgres: disable load_extension on the wire listener
tursopg --server reused DatabaseOpts::turso_cli(), which turns on SQL
load_extension. The listener has no password (NoopHandler). A client
could SELECT load_extension and run native code in the server process.

Interactive CLI still enables the flag. The wire path uses the library
default (off), matching sqlite3_enable_load_extension and #3250.

Tests: tursopg wire_load_extension_is_disabled,
       repl_load_extension_still_attempts_to_open_the_file
Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
2026-10-15 08:16:48 +03:00
..
2026-07-16 12:40:03 +03:00
2026-08-11 05:07:30 -05:00
2026-08-12 21:48:54 -07:00

tursopg

In-process PostgreSQL reimplementation backed by Turso's SQLite-compatible engine.

tursopg translates PostgreSQL SQL (via libpg_query) directly into Turso's AST, then executes it through the full Turso compilation and bytecode pipeline. No SQLite text is ever generated — the entire path from PG parse tree to bytecode is native.

Live Materialized Views

Unlike PostgreSQL, where materialized views are static snapshots that require REFRESH MATERIALIZED VIEW to update, tursopg's materialized views are live. They automatically reflect changes to the underlying tables without any manual refresh step.

This is possible because Turso implements materialized views using DBSP (Differential DataFlow Stream Processing) for incremental maintenance. When you insert, update, or delete rows in a base table, the materialized view is updated incrementally — no full recomputation needed.

CREATE TABLE sales(product TEXT, amount INT);
INSERT INTO sales VALUES ('Widget', 100);

CREATE MATERIALIZED VIEW totals AS
  SELECT product, SUM(amount) as total FROM sales GROUP BY product;

SELECT * FROM totals;
-- Widget | 100

INSERT INTO sales VALUES ('Widget', 50);

-- No REFRESH needed — the view is already up to date
SELECT * FROM totals;
-- Widget | 150

REFRESH MATERIALIZED VIEW is accepted for compatibility but is a no-op. DROP MATERIALIZED VIEW works as expected.