[HN Gopher] Making SQLite extensions pip install-able ___________________________________________________________________ Making SQLite extensions pip install-able Author : simonw Score : 66 points Date : 2023-02-06 19:50 UTC (3 hours ago) (HTM) web link (observablehq.com) (TXT) w3m dump (observablehq.com) | alexgarcia-xyz wrote: | Author here, happy to answer questions! | | Simon already gave a great intro to my SQLite extensions, and I | just want to point folks to Anton Zhiyanov's sqlean project, for | pure-C extensions: https://github.com/nalgeon/sqlean | | Also, some of these extensions are also packaged as Datasette | plugins, so you can also run `datasette install datasette-sqlite- | regex` or `datasette install datasette-sqlite-ulid` to add these | extension to your Datasette instances! | https://docs.datasette.io/en/stable/plugins.html | nalgeon wrote: | Alex has developed a framework that allows him to write SQLite | extensions in Rust instead of C. Very clever! This way, he can be | productive and avoid a lot of potential bugs while keeping the | raw performance. | | As a maintainer of a large set of C SQLite extensions, I envy him | :) | simonw wrote: | This is such a huge step forward for the usability of custom | SQLite extensions in Python world. | | Alex has a whole family of SQLite extensions that he's built in | Rust which are worth checking out: | | - sqlite-xsv: https://github.com/asg017/sqlite-xsv | | - sqlite-fastrand: https://github.com/asg017/sqlite-fastrand | | - sqlite-ulid: https://github.com/asg017/sqlite-ulid | | - sqlite-jsonschema: https://github.com/asg017/sqlite-jsonschema | | - sqlite-regex: https://github.com/asg017/sqlite-regex | | - sqlite-url: https://github.com/asg017/sqlite-url | | - sqlite-http: https://github.com/asg017/sqlite-http | | - sqlite-lines: https://github.com/asg017/sqlite-lines | | - sqlite-path: https://github.com/asg017/sqlite-path | | - sqlite-html: https://github.com/asg017/sqlite-html | [deleted] | beckingz wrote: | So how soon do we get sqlite extensions in the browser with | WASM? | alexgarcia-xyz wrote: | It's possible but very difficult. For extensions built purely | in C, you can statically compile extensions into a SQLite | WASM build, which I have a few demos of with sqlite-lines [0] | and sqlite-path[1]. | | For extensions but in Rust however, it's much more difficult. | Matt @tantaman has some success cross compiling his cr-sqlite | [2] project to WASM, but it's quite complex. | | SQLite extensions typical rely on dlopen() to load dynamic | libraries as an extension. WASM doesn't really have that, so | you either have to statically compile your extension in your | WASM build (which is difficult for non-C languages bc SQLite | is written in C), or hack around some barely-supported WASM | features that emulate dlopen(). Though I'm not the best with | WASM, so hopefully someone with more WASM experience chimes | in to help! It's something I'm tracking in this issue for the | `sqlite-loadble-rs` project [3] | | [0] https://observablehq.com/@asg017/introducing-sqlite- | lines#ce... | | [1] https://observablehq.com/@asg017/introducing-sqlite- | path#cel... | | [2] https://github.com/vlcn-io/cr-sqlite | | [3] https://github.com/asg017/sqlite-loadable-rs/issues/5 | axelthegerman wrote: | Does anybody know how feasible this would be with rubygems? Gems | can build native extension so maybe possible? ___________________________________________________________________ (page generated 2023-02-06 23:00 UTC)