diff --git a/embed/README.md b/embed/README.md index ba279a6..0f79f7a 100644 --- a/embed/README.md +++ b/embed/README.md @@ -1,6 +1,6 @@ # Embeddable Wasm build of SQLite -This folder includes an embeddable Wasm build of SQLite 3.50.0 for use with +This folder includes an embeddable Wasm build of SQLite 3.50.1 for use with [`github.com/ncruces/go-sqlite3`](https://pkg.go.dev/github.com/ncruces/go-sqlite3). The following optional features are compiled in: diff --git a/embed/bcw2/bcw2.wasm b/embed/bcw2/bcw2.wasm index 7a03d1b..113be09 100755 Binary files a/embed/bcw2/bcw2.wasm and b/embed/bcw2/bcw2.wasm differ diff --git a/embed/bcw2/bcw2_test.go b/embed/bcw2/bcw2_test.go index cebb285..03e5f3c 100644 --- a/embed/bcw2/bcw2_test.go +++ b/embed/bcw2/bcw2_test.go @@ -53,7 +53,7 @@ func Test_bcw2(t *testing.T) { if err != nil { t.Fatal(err) } - if version != "3.50.0" { + if version != "3.51.0" { t.Error(version) } } diff --git a/embed/bcw2/build.sh b/embed/bcw2/build.sh index b9f18ae..7b5a56e 100755 --- a/embed/bcw2/build.sh +++ b/embed/bcw2/build.sh @@ -13,8 +13,8 @@ mkdir -p build/ext/ cp "$ROOT"/sqlite3/*.[ch] build/ cp "$ROOT"/sqlite3/*.patch build/ -# https://sqlite.org/src/info/54b8888080d99a87 -curl -# https://sqlite.org/src/tarball/sqlite.tar.gz?r=54b8888080 | tar xz +# https://sqlite.org/src/info/93740658c8c6f531 +curl -# https://sqlite.org/src/tarball/sqlite.tar.gz?r=93740658c8 | tar xz cd sqlite if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then diff --git a/embed/bcw2/go.mod b/embed/bcw2/go.mod index ba85c0f..17221dc 100644 --- a/embed/bcw2/go.mod +++ b/embed/bcw2/go.mod @@ -4,11 +4,11 @@ go 1.23.0 toolchain go1.24.0 -require github.com/ncruces/go-sqlite3 v0.25.0 +require github.com/ncruces/go-sqlite3 v0.26.0 require ( github.com/ncruces/julianday v1.0.0 // indirect github.com/ncruces/sort v0.1.5 // indirect github.com/tetratelabs/wazero v1.9.0 // indirect - golang.org/x/sys v0.32.0 // indirect + golang.org/x/sys v0.33.0 // indirect ) diff --git a/embed/bcw2/go.sum b/embed/bcw2/go.sum index c9e6996..4cd73fa 100644 --- a/embed/bcw2/go.sum +++ b/embed/bcw2/go.sum @@ -1,12 +1,12 @@ -github.com/ncruces/go-sqlite3 v0.25.0 h1:trugKUs98Zwy9KwRr/EUxZHL92LYt7UqcKqAfpGpK+I= -github.com/ncruces/go-sqlite3 v0.25.0/go.mod h1:n6Z7036yFilJx04yV0mi5JWaF66rUmXn1It9Ux8dx68= +github.com/ncruces/go-sqlite3 v0.26.0 h1:dY6ASfuhSEbtSge6kJwjyJVC7bXCpgEVOycmdboKJek= +github.com/ncruces/go-sqlite3 v0.26.0/go.mod h1:46HIzeCQQ+aNleAxCli+vpA2tfh7ttSnw24kQahBc1o= github.com/ncruces/julianday v1.0.0 h1:fH0OKwa7NWvniGQtxdJRxAgkBMolni2BjDHaWTxqt7M= github.com/ncruces/julianday v1.0.0/go.mod h1:Dusn2KvZrrovOMJuOt0TNXL6tB7U2E8kvza5fFc9G7g= github.com/ncruces/sort v0.1.5 h1:fiFWXXAqKI8QckPf/6hu/bGFwcEPrirIOFaJqWujs4k= github.com/ncruces/sort v0.1.5/go.mod h1:obJToO4rYr6VWP0Uw5FYymgYGt3Br4RXcs/JdKaXAPk= github.com/tetratelabs/wazero v1.9.0 h1:IcZ56OuxrtaEz8UYNRHBrUa9bYeX9oVY93KspZZBf/I= github.com/tetratelabs/wazero v1.9.0/go.mod h1:TSbcXCfFP0L2FGkRPxHphadXPjo1T6W+CseNNY7EkjM= -golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= -golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= +golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= +golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= +golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= diff --git a/embed/init_test.go b/embed/init_test.go index 670aa6a..ba64846 100644 --- a/embed/init_test.go +++ b/embed/init_test.go @@ -19,7 +19,7 @@ func Test_init(t *testing.T) { if err != nil { t.Fatal(err) } - if version != "3.50.0" { + if version != "3.50.1" { t.Error(version) } } diff --git a/embed/sqlite3.wasm b/embed/sqlite3.wasm index c596e63..be08c9d 100755 Binary files a/embed/sqlite3.wasm and b/embed/sqlite3.wasm differ diff --git a/ext/README.md b/ext/README.md index f08f338..d10dacb 100644 --- a/ext/README.md +++ b/ext/README.md @@ -30,7 +30,7 @@ you can load into your database connections. - [`github.com/ncruces/go-sqlite3/ext/statement`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/ext/statement) creates [parameterized views](https://github.com/0x09/sqlite-statement-vtab). - [`github.com/ncruces/go-sqlite3/ext/stats`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/ext/stats) - provides [statistics](https://www.oreilly.com/library/view/sql-in-a/9780596155322/ch04s02.html) functions. + provides [statistics](https://oreilly.com/library/view/sql-in-a/9780596155322/ch04s02.html) functions. - [`github.com/ncruces/go-sqlite3/ext/unicode`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/ext/unicode) provides [Unicode aware](https://sqlite.org/src/dir/ext/icu) functions. - [`github.com/ncruces/go-sqlite3/ext/uuid`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/ext/uuid) diff --git a/ext/regexp/regexp_test.go b/ext/regexp/regexp_test.go index 63906f4..02d2205 100644 --- a/ext/regexp/regexp_test.go +++ b/ext/regexp/regexp_test.go @@ -38,7 +38,7 @@ func TestRegister(t *testing.T) { {`regexp_instr('Hello', '.', 6)`, ""}, {`regexp_substr('Hello', 'el.')`, "ell"}, {`regexp_replace('Hello', 'llo', 'll')`, "Hell"}, - // https://www.postgresql.org/docs/current/functions-matching.html + // https://postgresql.org/docs/current/functions-matching.html {`regexp_count('ABCABCAXYaxy', 'A.')`, "3"}, {`regexp_count('ABCABCAXYaxy', '(?i)A.', 1)`, "4"}, {`regexp_instr('number of your street, town zip, FR', '[^,]+', 1, 2)`, "23"}, diff --git a/ext/stats/TODO.md b/ext/stats/TODO.md index d8d2f35..e36a97e 100644 --- a/ext/stats/TODO.md +++ b/ext/stats/TODO.md @@ -1,6 +1,6 @@ # ANSI SQL Aggregate Functions -https://www.oreilly.com/library/view/sql-in-a/9780596155322/ch04s02.html +https://oreilly.com/library/view/sql-in-a/9780596155322/ch04s02.html ## Built in aggregates diff --git a/ext/stats/stats.go b/ext/stats/stats.go index a345cb8..9a8ebe8 100644 --- a/ext/stats/stats.go +++ b/ext/stats/stats.go @@ -47,7 +47,7 @@ // // [Built-in Aggregate Functions]: https://sqlite.org/lang_aggfunc.html // [Built-in Window Functions]: https://sqlite.org/windowfunctions.html#builtins -// [ANSI SQL Aggregate Functions]: https://www.oreilly.com/library/view/sql-in-a/9780596155322/ch04s02.html +// [ANSI SQL Aggregate Functions]: https://oreilly.com/library/view/sql-in-a/9780596155322/ch04s02.html package stats import ( diff --git a/gormlite/go.mod b/gormlite/go.mod index 4014629..26a52b8 100644 --- a/gormlite/go.mod +++ b/gormlite/go.mod @@ -5,8 +5,8 @@ go 1.23.0 toolchain go1.24.0 require ( - github.com/ncruces/go-sqlite3 v0.25.0 - gorm.io/gorm v1.25.12 + github.com/ncruces/go-sqlite3 v0.26.0 + gorm.io/gorm v1.30.0 ) require ( @@ -14,6 +14,6 @@ require ( github.com/jinzhu/now v1.1.5 // indirect github.com/ncruces/julianday v1.0.0 // indirect github.com/tetratelabs/wazero v1.9.0 // indirect - golang.org/x/sys v0.32.0 // indirect - golang.org/x/text v0.24.0 // indirect + golang.org/x/sys v0.33.0 // indirect + golang.org/x/text v0.26.0 // indirect ) diff --git a/gormlite/go.sum b/gormlite/go.sum index 3363b0f..aa30ed1 100644 --- a/gormlite/go.sum +++ b/gormlite/go.sum @@ -2,15 +2,15 @@ github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/ncruces/go-sqlite3 v0.25.0 h1:trugKUs98Zwy9KwRr/EUxZHL92LYt7UqcKqAfpGpK+I= -github.com/ncruces/go-sqlite3 v0.25.0/go.mod h1:n6Z7036yFilJx04yV0mi5JWaF66rUmXn1It9Ux8dx68= +github.com/ncruces/go-sqlite3 v0.26.0 h1:dY6ASfuhSEbtSge6kJwjyJVC7bXCpgEVOycmdboKJek= +github.com/ncruces/go-sqlite3 v0.26.0/go.mod h1:46HIzeCQQ+aNleAxCli+vpA2tfh7ttSnw24kQahBc1o= github.com/ncruces/julianday v1.0.0 h1:fH0OKwa7NWvniGQtxdJRxAgkBMolni2BjDHaWTxqt7M= github.com/ncruces/julianday v1.0.0/go.mod h1:Dusn2KvZrrovOMJuOt0TNXL6tB7U2E8kvza5fFc9G7g= github.com/tetratelabs/wazero v1.9.0 h1:IcZ56OuxrtaEz8UYNRHBrUa9bYeX9oVY93KspZZBf/I= github.com/tetratelabs/wazero v1.9.0/go.mod h1:TSbcXCfFP0L2FGkRPxHphadXPjo1T6W+CseNNY7EkjM= -golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= -golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= -golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= -gorm.io/gorm v1.25.12 h1:I0u8i2hWQItBq1WfE0o2+WuL9+8L21K9e2HHSTE/0f8= -gorm.io/gorm v1.25.12/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ= +golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= +golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= +golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= +gorm.io/gorm v1.30.0 h1:qbT5aPv1UH8gI99OsRlvDToLxW5zR7FzS9acZDOZcgs= +gorm.io/gorm v1.30.0/go.mod h1:8Z33v652h4//uMA76KjeDH8mJXPm1QNCYrMeatR0DOE= diff --git a/gormlite/sqlite.go b/gormlite/sqlite.go index 889bec1..7b3243c 100644 --- a/gormlite/sqlite.go +++ b/gormlite/sqlite.go @@ -1,4 +1,3 @@ -// Package gormlite provides a GORM driver for SQLite. package gormlite import ( @@ -52,7 +51,9 @@ func (dialector _Dialector) Initialize(db *gorm.DB) (err error) { }) for k, v := range dialector.ClauseBuilders() { - db.ClauseBuilders[k] = v + if _, ok := db.ClauseBuilders[k]; !ok { + db.ClauseBuilders[k] = v + } } return } diff --git a/gormlite/test.sh b/gormlite/test.sh index ccbc3fa..2f55301 100755 --- a/gormlite/test.sh +++ b/gormlite/test.sh @@ -7,7 +7,7 @@ rm -rf gorm/ tests/ go work use -r . go test -git clone --branch v1.25.12 --filter=blob:none https://github.com/go-gorm/gorm.git +git clone --branch v1.30.0 --filter=blob:none https://github.com/go-gorm/gorm.git mv gorm/tests tests rm -rf gorm/ diff --git a/gormlite/update.sh b/gormlite/update.sh index eacc779..e880951 100755 --- a/gormlite/update.sh +++ b/gormlite/update.sh @@ -3,12 +3,12 @@ set -euo pipefail cd -P -- "$(dirname -- "$0")" -curl -#OL "https://github.com/go-gorm/sqlite/raw/v1.5.7/ddlmod.go" -curl -#OL "https://github.com/go-gorm/sqlite/raw/v1.5.7/ddlmod_test.go" -curl -#OL "https://github.com/go-gorm/sqlite/raw/v1.5.7/ddlmod_parse_all_columns.go" -curl -#OL "https://github.com/go-gorm/sqlite/raw/v1.5.7/ddlmod_parse_all_columns_test.go" -curl -#OL "https://github.com/go-gorm/sqlite/raw/v1.5.7/error_translator.go" -curl -#OL "https://github.com/go-gorm/sqlite/raw/v1.5.7/migrator.go" -curl -#OL "https://github.com/go-gorm/sqlite/raw/v1.5.7/sqlite.go" -curl -#OL "https://github.com/go-gorm/sqlite/raw/v1.5.7/sqlite_test.go" +curl -#OL "https://github.com/go-gorm/sqlite/raw/v1.6.0/ddlmod.go" +curl -#OL "https://github.com/go-gorm/sqlite/raw/v1.6.0/ddlmod_test.go" +curl -#OL "https://github.com/go-gorm/sqlite/raw/v1.6.0/ddlmod_parse_all_columns.go" +curl -#OL "https://github.com/go-gorm/sqlite/raw/v1.6.0/ddlmod_parse_all_columns_test.go" +curl -#OL "https://github.com/go-gorm/sqlite/raw/v1.6.0/error_translator.go" +curl -#OL "https://github.com/go-gorm/sqlite/raw/v1.6.0/migrator.go" +curl -#OL "https://github.com/go-gorm/sqlite/raw/v1.6.0/sqlite.go" +curl -#OL "https://github.com/go-gorm/sqlite/raw/v1.6.0/sqlite_test.go" curl -#L "https://github.com/glebarez/sqlite/raw/v1.11.0/sqlite_error_translator_test.go" > error_translator_test.go \ No newline at end of file diff --git a/sqlite3/download.sh b/sqlite3/download.sh index 3dd8b03..582e9dc 100755 --- a/sqlite3/download.sh +++ b/sqlite3/download.sh @@ -3,7 +3,7 @@ set -euo pipefail cd -P -- "$(dirname -- "$0")" -curl -#OL "https://sqlite.org/2025/sqlite-amalgamation-3500000.zip" +curl -#OL "https://sqlite.org/2025/sqlite-amalgamation-3500100.zip" unzip -d . sqlite-amalgamation-*.zip mv sqlite-amalgamation-*/sqlite3.c . mv sqlite-amalgamation-*/sqlite3.h . @@ -19,30 +19,30 @@ rm -rf sqlite-amalgamation-* mkdir -p ext/ cd ext/ -curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.0/ext/misc/anycollseq.c" -curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.0/ext/misc/base64.c" -curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.0/ext/misc/decimal.c" -curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.0/ext/misc/ieee754.c" -curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.0/ext/misc/regexp.c" -curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.0/ext/misc/series.c" -curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.0/ext/misc/spellfix.c" -curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.0/ext/misc/uint.c" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.1/ext/misc/anycollseq.c" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.1/ext/misc/base64.c" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.1/ext/misc/decimal.c" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.1/ext/misc/ieee754.c" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.1/ext/misc/regexp.c" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.1/ext/misc/series.c" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.1/ext/misc/spellfix.c" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.1/ext/misc/uint.c" cd ~- cd ../vfs/tests/mptest/testdata/ -curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.0/mptest/config01.test" -curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.0/mptest/config02.test" -curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.0/mptest/crash01.test" -curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.0/mptest/crash02.subtest" -curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.0/mptest/multiwrite01.test" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.1/mptest/config01.test" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.1/mptest/config02.test" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.1/mptest/crash01.test" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.1/mptest/crash02.subtest" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.1/mptest/multiwrite01.test" cd ~- cd ../vfs/tests/mptest/wasm/ -curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.0/mptest/mptest.c" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.1/mptest/mptest.c" cd ~- cd ../vfs/tests/speedtest1/wasm/ -curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.0/test/speedtest1.c" +curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.50.1/test/speedtest1.c" cd ~- cat *.patch | patch -p0 --no-backup-if-mismatch \ No newline at end of file diff --git a/vfs/README.md b/vfs/README.md index 17c24ec..68cb92d 100644 --- a/vfs/README.md +++ b/vfs/README.md @@ -23,7 +23,7 @@ POSIX advisory locks, which SQLite uses on [Unix](https://github.com/sqlite/sqlite/blob/5d60f4/src/os_unix.c#L13-L14), are [broken by design](https://github.com/sqlite/sqlite/blob/5d60f4/src/os_unix.c#L1074-L1162). Instead, on Linux and macOS, this package uses -[OFD locks](https://www.gnu.org/software/libc/manual/html_node/Open-File-Description-Locks.html) +[OFD locks](https://gnu.org/software/libc/manual/html_node/Open-File-Description-Locks.html) to synchronize access to database files. This package can also use diff --git a/vfs/tests/mptest/wasm/mptest.wasm b/vfs/tests/mptest/wasm/mptest.wasm index 912be38..d6689a9 100644 Binary files a/vfs/tests/mptest/wasm/mptest.wasm and b/vfs/tests/mptest/wasm/mptest.wasm differ diff --git a/vfs/tests/speedtest1/wasm/speedtest1.wasm b/vfs/tests/speedtest1/wasm/speedtest1.wasm index 8dfa28d..aa98811 100644 Binary files a/vfs/tests/speedtest1/wasm/speedtest1.wasm and b/vfs/tests/speedtest1/wasm/speedtest1.wasm differ