[Starting from 3.41.0 SQLite has wasm32-wasi support out of the
box.][0]
- Set `-DSQLITE_THREADSAFE=0`. Fixes:
```
$ wasmtime target/wasm32-wasi/release/examples/persons.wasm
Error: failed to run main module `target/wasm32-wasi/release/examples/persons.wasm`
Caused by:
0: failed to instantiate "target/wasm32-wasi/release/examples/persons.wasm"
1: unknown import: `env::pthread_mutexattr_init` has not been defined
```
- Drop `-DSQLITE_OS_OTHER`. Fixes:
```
$ wasmtime target/wasm32-wasi/release/examples/persons.wasm
Error: failed to run main module `target/wasm32-wasi/release/examples/persons.wasm`
Caused by:
0: failed to instantiate "target/wasm32-wasi/release/examples/persons.wasm"
1: unknown import: `env::sqlite3_os_init` has not been defined
```
- [Add wasi specific build flags][1]
- Add basic example
- Also, add instructions how to run it against wasm32-wasi.
Using of file databases is also working, though `--mapdir` arg
should be provided to `wasmtime run`.
[0]: https://wasmlabs.dev/articles/sqlite-wasi-support/
[1]: https://github.com/vmware-labs/webassembly-language-runtimes/blob/main/libs/sqlite/wasi-patches/wlr-build.sh#L11
This commit introduces new env var, LIBSQLITE3_SYS_USE_PKG_CONFIG,
which can be set to non-zero values to force building against sqlite
libraries from the system overriding bundled features.
From 3.6.8 to 3.14.0.
Use `old_sqlite` feature to keep 3.6.8 (or 3.7.16) as the minimal version.
Use `modern_sqlite` for SQLite API > 3.14.0.
Also remove old 3.6.23 and 3.7.7 bindings.
The auto-generated bindgen layout tests are architecture dependent and
cause breakage on 32-bit platforms at least.
Note that this does not yet remove the layout tests from
bindgen-bindings/bindgen_*.rs -- i'm not sure how those are generated.
Addresses: #722