mirror of
https://github.com/ncruces/go-sqlite3.git
synced 2026-01-12 05:59:14 +00:00
SQLite 3.41.1.
This commit is contained in:
1
conn.go
1
conn.go
@@ -69,6 +69,7 @@ func (c *Conn) openDB(filename string, flags OpenFlag) (uint32, error) {
|
|||||||
connPtr := c.arena.new(ptrlen)
|
connPtr := c.arena.new(ptrlen)
|
||||||
namePtr := c.arena.string(filename)
|
namePtr := c.arena.string(filename)
|
||||||
|
|
||||||
|
flags |= OPEN_EXRESCODE
|
||||||
r := c.call(c.api.open, uint64(namePtr), uint64(connPtr), uint64(flags), 0)
|
r := c.call(c.api.open, uint64(namePtr), uint64(connPtr), uint64(flags), 0)
|
||||||
|
|
||||||
handle := c.mem.readUint32(connPtr)
|
handle := c.mem.readUint32(connPtr)
|
||||||
|
|||||||
@@ -13,4 +13,10 @@ zig cc --target=wasm32-wasi -flto -g0 -Os \
|
|||||||
-mbulk-memory -mreference-types \
|
-mbulk-memory -mreference-types \
|
||||||
-mnontrapping-fptoint -msign-ext \
|
-mnontrapping-fptoint -msign-ext \
|
||||||
-D_HAVE_SQLITE_CONFIG_H \
|
-D_HAVE_SQLITE_CONFIG_H \
|
||||||
$(awk '{print "-Wl,--export="$0}' exports.txt)
|
$(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
|
||||||
@@ -40,7 +40,6 @@ sqlite3_blob_reopen
|
|||||||
sqlite3_get_autocommit
|
sqlite3_get_autocommit
|
||||||
sqlite3_last_insert_rowid
|
sqlite3_last_insert_rowid
|
||||||
sqlite3_changes64
|
sqlite3_changes64
|
||||||
sqlite3_unlock_notify
|
|
||||||
sqlite3_backup_init
|
sqlite3_backup_init
|
||||||
sqlite3_backup_step
|
sqlite3_backup_step
|
||||||
sqlite3_backup_finish
|
sqlite3_backup_finish
|
||||||
|
|||||||
BIN
embed/sqlite3.wasm
Executable file → Normal file
BIN
embed/sqlite3.wasm
Executable file → Normal file
Binary file not shown.
@@ -3,9 +3,8 @@
|
|||||||
#include "main.c"
|
#include "main.c"
|
||||||
#include "os.c"
|
#include "os.c"
|
||||||
#include "qsort.c"
|
#include "qsort.c"
|
||||||
#include "time.c"
|
|
||||||
|
|
||||||
#include "sqlite3.c"
|
#include "sqlite3.c"
|
||||||
|
#include "time.c"
|
||||||
|
|
||||||
sqlite3_destructor_type malloc_destructor = &free;
|
sqlite3_destructor_type malloc_destructor = &free;
|
||||||
size_t sqlite3_interrupt_offset = offsetof(sqlite3, u1.isInterrupted);
|
size_t sqlite3_interrupt_offset = offsetof(sqlite3, u1.isInterrupted);
|
||||||
@@ -4,7 +4,7 @@ set -eo pipefail
|
|||||||
cd -P -- "$(dirname -- "$0")"
|
cd -P -- "$(dirname -- "$0")"
|
||||||
|
|
||||||
if [ ! -f "sqlite3.c" ]; then
|
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
|
curl "$url" > sqlite.zip
|
||||||
unzip -d . sqlite.zip
|
unzip -d . sqlite.zip
|
||||||
mv sqlite-amalgamation-*/sqlite3* .
|
mv sqlite-amalgamation-*/sqlite3* .
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
cd -P -- "$(dirname -- "$0")"
|
cd -P -- "$(dirname -- "$0")"
|
||||||
|
|
||||||
clang-format -i \
|
shopt -s extglob
|
||||||
main.c \
|
clang-format -i !(sqlite3*).@(c|h)
|
||||||
os.c \
|
|
||||||
qsort.c \
|
|
||||||
amalg.c
|
|
||||||
7
tests/mptest/testdata/build.sh
vendored
7
tests/mptest/testdata/build.sh
vendored
@@ -23,4 +23,9 @@ zig cc --target=wasm32-wasi -flto -g0 -Os \
|
|||||||
-DSQLITE_DEFAULT_LOCKING_MODE=0 \
|
-DSQLITE_DEFAULT_LOCKING_MODE=0 \
|
||||||
-DHAVE_USLEEP -DSQLITE_NO_SYNC \
|
-DHAVE_USLEEP -DSQLITE_NO_SYNC \
|
||||||
-DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
|
-DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION \
|
||||||
-D_WASI_EMULATED_GETPID -lwasi-emulated-getpid
|
-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
4
tests/mptest/testdata/mptest.wasm
vendored
Executable file → Normal file
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:3960b873a7dab969a66f7859d491cec0dd4e6c0c9f83eab449fb15ec5ebdfd8f
|
oid sha256:56ba9702a874d9ebf8a7eab2b39f7f74127931038fa8c9298b59120ae20a4653
|
||||||
size 1077281
|
size 969013
|
||||||
|
|||||||
Reference in New Issue
Block a user