mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-24 19:44:21 +01:00
This PR adds support for table-valued functions for PRAGMAs (see the [PRAGMA functions section](https://www.sqlite.org/pragma.html)). Additionally, it introduces built-in table-valued functions. I considered using extensions for this, but there are several reasons in favor of a dedicated mechanism: * It simplifies the use of internal functions, structs, etc. For example, when implementing `json_each` and `json_tree`, direct access to internals was necessary: https://github.com/tursodatabase/limbo/pull/1088 * It avoids FFI overhead. [Benchmarks](https://github.com/piotrrzysko/li mbo/blob/pragma_vtabs_bench/core/benches/pragma_benchmarks.rs) on my hardware show that `pragma_table_info()` implemented as an extension is 2.5× slower than the built-in version. Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #1642