3 ms·
They're awesome! One common use case is REGEXP. SQLite has a keyword for regular expression matching, but it has no implementation for it. What your applicatio
by TeMPOraL 6y ago
They're awesome!
One common use case is REGEXP. SQLite has a keyword for regular expression matching, but it has no implementation for it. What your application needs to do is to take whatever regex library it's using, make (through whatever FFI method it's using) a C function that interfaces with it, and register it with SQLite.
A more advanced feature of this binding mechanism is that, if you provide a bunch of specific callbacks to SQLite, you can expose anything you like as a virtual table, that can be queried and operated on as if it was just another SQLite table.
See: https://www.sqlite.org/vtab.html https://www.sqlite.org/vtab.html. The plugin for full-text search is implemented in terms of this mechanism.