emscripten-forge / recipes

Recipes to build the packages for the emscripten-forge distribution
BSD 3-Clause "New" or "Revised" License
56 stars 49 forks source link

Replace `sqlite3` recipe with native WASM version? #1254

Open michaelweinold opened 3 months ago

michaelweinold commented 3 months ago

Unfortunately, a simple sqlite3 test of this kind:

import sqlite3
con = sqlite3.connect("tutorial.db")
cur = con.cursor()
cur.execute("CREATE TABLE movie(title, year, score)")
res = cur.execute("SELECT name FROM sqlite_master")

still does not work with the default drive of either the IndexDB or the LocalStorage drivers, as documented here:

However, SQlite from v3.40.0 now includes:

(...) support for compiling SQLite to WASM and running it in web browsers.

it is available for download as

A precompiled bundle of sqlite3.wasm and its JavaScript APIs, ready for use in web applications.

The version included in the emscripten-forge recipes is still v.3.37.2.

Maybe this will solve some of the SQLite/WASM file-system issues.

Would it make sense to use this WASM-native version from now on? How could this be included - persumably, this would not need to be built from source?