SQL
7 posts from the Query.Farm blog tagged SQL.
Rhai for DuckDB 2.0: cached rules and bounded execution
DuckDB’s Rhai extension now caches compiled rules, limits their work, and removes filesystem access while keeping per-row results and errors queryable in SQL.
MiniJinja for DuckDB 2.0: a budget for rendering templates
MiniJinja’s DuckDB 2.0 branch adds per-render instruction budgets, correct undefined modes, reusable templates, and file loading through DuckDB’s access controls.
QuickJS for DuckDB 2.0: pass real values to JavaScript
QuickJS for DuckDB 2.0 passes lists, structs, dates, and large integers as native JavaScript values, with memory limits, timeouts, and fixes for crashing scripts.
Tera for DuckDB 2.0: template files follow the database’s rules
Tera for DuckDB 2.0 checks template file access, disables environment reads by default, catches recursive templates, and reuses parsed templates across rows.
Stochastic for DuckDB 2.0: fit, compare and test distributions in SQL
The Stochastic extension for DuckDB 2.0 fits 22 distributions, ranks candidate fits by AICc with dist_fits, and adds hypothesis tests and 14 new distributions, all fuzzed until every function returns an answer or a clear error. We follow a support team answering a question about repair times in SQL.
Call an API From Every Row in DuckDB, Without the Loop
A table function turns an API call into rows in your database. A LATERAL join lets every row on the left call it — and VGI makes those calls in batches.
A SQL WHERE Clause for Taste
I pointed DuckDB at Hacker News and at Jev, TypeSafe's decision model, and asked it to score 500 stories against one sentence about what I like. It took 17 seconds and cost less than a penny.