Simon Willison: Can DuckDB Run Untrusted SQL as Safely as Datasette Runs SQLite?
Simon Willison·low signal
Willison's research post concludes DuckDB can match or exceed SQLite's safety for untrusted SQL, but only with a hardened config (enable_external_access=false, lock_configuration=true) plus a watchdog thread, since DuckDB lacks SQLite's opcode-based query timeouts. He ships a safe_duckdb.py helper and a datasette_duckdb.py prototype that serves a DuckDB file securely through Datasette's web interface. Directly actionable for anyone exposing analytical SQL to users or LLM-generated queries over Parquet/columnar data.