SQLite 3.41.1.

This commit is contained in:
Nuno Cruces
2023-03-15 13:29:09 +00:00
parent 71da34861b
commit 77088962f5
9 changed files with 20 additions and 13 deletions

View File

@@ -69,6 +69,7 @@ func (c *Conn) openDB(filename string, flags OpenFlag) (uint32, error) {
connPtr := c.arena.new(ptrlen)
namePtr := c.arena.string(filename)
flags |= OPEN_EXRESCODE
r := c.call(c.api.open, uint64(namePtr), uint64(connPtr), uint64(flags), 0)
handle := c.mem.readUint32(connPtr)

View File

@@ -14,3 +14,9 @@ zig cc --target=wasm32-wasi -flto -g0 -Os \
-mnontrapping-fptoint -msign-ext \
-D_HAVE_SQLITE_CONFIG_H \
$(awk '{print "-Wl,--export="$0}' exports.txt)
# optimize SQLite
if which wasm-opt; then
wasm-opt -g -O -o sqlite3.tmp sqlite3.wasm
mv sqlite3.tmp sqlite3.wasm
fi

View File

@@ -40,7 +40,6 @@ sqlite3_blob_reopen
sqlite3_get_autocommit
sqlite3_last_insert_rowid
sqlite3_changes64
sqlite3_unlock_notify
sqlite3_backup_init
sqlite3_backup_step
sqlite3_backup_finish

BIN
embed/sqlite3.wasm Executable file → Normal file

Binary file not shown.

View File

@@ -3,9 +3,8 @@
#include "main.c"
#include "os.c"
#include "qsort.c"
#include "time.c"
#include "sqlite3.c"
#include "time.c"
sqlite3_destructor_type malloc_destructor = &free;
size_t sqlite3_interrupt_offset = offsetof(sqlite3, u1.isInterrupted);

View File

@@ -4,7 +4,7 @@ set -eo pipefail
cd -P -- "$(dirname -- "$0")"
if [ ! -f "sqlite3.c" ]; then
url="https://sqlite.org/2023/sqlite-amalgamation-3410000.zip"
url="https://sqlite.org/2023/sqlite-amalgamation-3410100.zip"
curl "$url" > sqlite.zip
unzip -d . sqlite.zip
mv sqlite-amalgamation-*/sqlite3* .

View File

@@ -1,8 +1,5 @@
#!/usr/bin/env bash
cd -P -- "$(dirname -- "$0")"
clang-format -i \
main.c \
os.c \
qsort.c \
amalg.c
shopt -s extglob
clang-format -i !(sqlite3*).@(c|h)

View File

@@ -24,3 +24,8 @@ zig cc --target=wasm32-wasi -flto -g0 -Os \
-DHAVE_USLEEP -DSQLITE_NO_SYNC \
-DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
-D_WASI_EMULATED_GETPID -lwasi-emulated-getpid
if which wasm-opt; then
wasm-opt -g -O -o mptest.tmp mptest.wasm
mv mptest.tmp mptest.wasm
fi

4
tests/mptest/testdata/mptest.wasm vendored Executable file → Normal file
View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3960b873a7dab969a66f7859d491cec0dd4e6c0c9f83eab449fb15ec5ebdfd8f
size 1077281
oid sha256:56ba9702a874d9ebf8a7eab2b39f7f74127931038fa8c9298b59120ae20a4653
size 969013