nalgeon / sqlean

The ultimate set of SQLite extensions
MIT License
3.65k stars 115 forks source link

wasm module #77

Closed alexbodn closed 1 year ago

alexbodn commented 1 year ago

hello andrey and thank you very much for extending sqlite. i'm particularly interested in the define module, since i'd like one db to be shared in python and js. sqlite is a powerful sql to go, and now browsers and phones can put very powerful environments in your pocket. i'd ask you to provide the modules as wasm, for use in the browser.

hope it's not a too heavy challenge.

nalgeon commented 1 year ago

Unfortunately, I have no idea how to make WASM extensions and how to make SQLite WASM build load them.

silver5753 commented 1 year ago

I'm not sure WASM is mature enough for dynamic shared library loading, but I might be wrong. In any case, the official SQLite WASM version (which is available to try on sqlime, another great project) has extension loading disabled. Select * from pragma_compile_options: OMIT_LOAD_EXTENSION

alexbodn commented 1 year ago

indeed would be interesting to dynamically load the modules, but if we don't know to do it, they may also be statically linked, if i understand correctly. i never compiled anything to wasm, that's why i asked it here.

alex

On Sun, Apr 23, 2023, 03:44 silver5753 @.***> wrote:

I'm not sure WASM is mature enough for dynamic shared library loading, but I might be wrong. In any case, the official SQLite WASM version (which is available to try on sqlime, another great project) has extension loading disabled. Select * from pragma_compile_options: OMIT_LOAD_EXTENSION

— Reply to this email directly, view it on GitHub https://github.com/nalgeon/sqlean/issues/77#issuecomment-1518906894, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABER7APBX4M56JJ5TTBNNJDXCR3OJANCNFSM6AAAAAAXA2766A . You are receiving this because you authored the thread.Message ID: @.***>

alexbodn commented 1 year ago

today i came across this wonderful module. if we could wasm it, sqlime would greatly benefit from it.

https://github.com/aergoio/sqlite-stored-procedures

what do you think?

alex

On Sun, Apr 23, 2023, 13:10 nick name @.***> wrote:

indeed would be interesting to dynamically load the modules, but if we don't know to do it, they may also be statically linked, if i understand correctly. i never compiled anything to wasm, that's why i asked it here.

alex

On Sun, Apr 23, 2023, 03:44 silver5753 @.***> wrote:

I'm not sure WASM is mature enough for dynamic shared library loading, but I might be wrong. In any case, the official SQLite WASM version (which is available to try on sqlime, another great project) has extension loading disabled. Select * from pragma_compile_options: OMIT_LOAD_EXTENSION

— Reply to this email directly, view it on GitHub https://github.com/nalgeon/sqlean/issues/77#issuecomment-1518906894, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABER7APBX4M56JJ5TTBNNJDXCR3OJANCNFSM6AAAAAAXA2766A . You are receiving this because you authored the thread.Message ID: @.***>

nalgeon commented 1 year ago

WASM build: https://github.com/nalgeon/sqlean.js

DBJDBJ commented 1 year ago
  1. WASI. https://wasi.dev/
  2. Look into https://training.linuxfoundation.org/blog/how-wasi-makes-containerization-more-efficient/ Sorry for brevity