▲ | oefrha 20 hours ago | |
Plus if you want to use functions inside queries, SQLite UDFs can be used from any language. E.g. for Node the better-sqlite3 binding has supported UDFs for ages; the new experimental node:sqlite also appears to have support[1][2], though I haven't used it. For Python UDFs are supported out of box. Etc. I can't see myself loading a js extension with a bundled engine exposing the same UDF capability when I can just use UDFs from the host language (which can be js with v8 already there) with access to whatever application state I want to expose, and arbitrary library code, rather than just the bare bones standard library shipped with QuickJS. What's the use case? Use rather awkward js functions in the sqlite3 CLI? [1] https://nodejs.org/api/sqlite.html#databasefunctionname-opti... [2] https://nodejs.org/api/sqlite.html#databaseaggregatename-opt... | ||
▲ | ncruces 14 hours ago | parent [-] | |
This stores the UDFs in the database. Which means each database can have its own UDFs. This makes more sense if you're someone who hosts the databases of others, but I it's still interesting otherwise. Like, if something like that was included in the CLI, one of the many browser apps, or the online playgrounds, your DBs could carry their own UDFs portably within themselves. It'd be even more interesting if it supported virtual tables as well. |