File tree Expand file tree Collapse file tree 6 files changed +21
-5
lines changed
Expand file tree Collapse file tree 6 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 11# Embeddable Wasm build of SQLite
22
3- This folder includes an embeddable Wasm build of SQLite, including the experimental
3+ This folder includes an alternative embeddable Wasm build of SQLite,
4+ which includes the experimental
45[ ` BEGIN CONCURRENT ` ] ( https://sqlite.org/src/doc/begin-concurrent/doc/begin_concurrent.md ) and
56[ Wal2] ( https://sqlite.org/cgi/src/doc/wal2/doc/wal2.md ) patches.
67
8+ It also enables the optional
9+ [ ` UPDATE … ORDER BY … LIMIT ` ] ( https://sqlite.org/lang_update.html#optional_limit_and_order_by_clauses ) and
10+ [ ` DELETE … ORDER BY … LIMIT ` ] ( https://sqlite.org/lang_delete.html#optional_limit_and_order_by_clauses ) clauses,
11+ and the [ ` WITHIN GROUP ORDER BY ` ] ( https://sqlite.org/compile.html#enable_ordered_set_aggregates ) aggregate syntax.
12+
713> [ !IMPORTANT]
814> This package is experimental.
915> It is built from the ` bedrock ` branch of SQLite,
10- > since that is _ currently_ the most stable, maintained branch to include both features.
16+ > since that is _ currently_ the most stable, maintained branch to include these features.
1117
1218> [ !CAUTION]
1319> The Wal2 journaling mode creates databases that other versions of SQLite cannot access.
Original file line number Diff line number Diff line change 55 "testing"
66
77 "github.com/ncruces/go-sqlite3/driver"
8+ "github.com/ncruces/go-sqlite3/ext/stats"
89 "github.com/ncruces/go-sqlite3/vfs"
910)
1011
@@ -15,7 +16,7 @@ func Test_bcw2(t *testing.T) {
1516
1617 tmp := filepath .ToSlash (filepath .Join (t .TempDir (), "test.db" ))
1718
18- db , err := driver .Open ("file:" + tmp + "?_pragma=journal_mode(wal2)&_txlock=concurrent" )
19+ db , err := driver .Open ("file:" + tmp + "?_pragma=journal_mode(wal2)&_txlock=concurrent" , stats . Register )
1920 if err != nil {
2021 t .Fatal (err )
2122 }
@@ -37,6 +38,11 @@ func Test_bcw2(t *testing.T) {
3738 t .Fatal (err )
3839 }
3940
41+ _ , err = tx .Exec (`SELECT median() WITHIN GROUP (ORDER BY col) FROM test` )
42+ if err != nil {
43+ t .Fatal (err )
44+ }
45+
4046 err = tx .Commit ()
4147 if err != nil {
4248 t .Fatal (err )
Original file line number Diff line number Diff line change @@ -18,9 +18,10 @@ curl -# https://sqlite.org/src/tarball/sqlite.tar.gz?r=ec5d7025 | tar xz
1818
1919cd sqlite
2020if [[ " $OSTYPE " == " msys" || " $OSTYPE " == " cygwin" ]]; then
21- MSYS_NO_PATHCONV=1 nmake /f makefile.msc sqlite3.c OPTS=-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT
21+ MSYS_NO_PATHCONV=1 nmake /f makefile.msc sqlite3.c " OPTS=-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT -DSQLITE_ENABLE_ORDERED_SET_AGGREGATES "
2222else
23- sh configure --enable-update-limit && make sqlite3.c
23+ sh configure --enable-update-limit
24+ OPTS=-DSQLITE_ENABLE_ORDERED_SET_AGGREGATES make sqlite3.c
2425fi
2526cd ~ -
2627
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ require github.com/ncruces/go-sqlite3 v0.21.3
88
99require (
1010 github.com/ncruces/julianday v1.0.0 // indirect
11+ github.com/ncruces/sort v0.1.2 // indirect
1112 github.com/tetratelabs/wazero v1.8.2 // indirect
1213 golang.org/x/sys v0.29.0 // indirect
1314)
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ github.com/ncruces/go-sqlite3 v0.21.3 h1:hHkfNQLcbnxPJZhC/RGw9SwP3bfkv/Y0xUHWsr1
22github.com/ncruces/go-sqlite3 v0.21.3 /go.mod h1:zxMOaSG5kFYVFK4xQa0pdwIszqxqJ0W0BxBgwdrNjuA =
33github.com/ncruces/julianday v1.0.0 h1:fH0OKwa7NWvniGQtxdJRxAgkBMolni2BjDHaWTxqt7M =
44github.com/ncruces/julianday v1.0.0 /go.mod h1:Dusn2KvZrrovOMJuOt0TNXL6tB7U2E8kvza5fFc9G7g =
5+ github.com/ncruces/sort v0.1.2 h1:zKQ9CA4fpHPF6xsUhRTfi5EEryspuBpe/QA4VWQOV1U =
6+ github.com/ncruces/sort v0.1.2 /go.mod h1:vEJUTBJtebIuCMmXD18GKo5GJGhsay+xZFOoBEIXFmE =
57github.com/tetratelabs/wazero v1.8.2 h1:yIgLR/b2bN31bjxwXHD8a3d+BogigR952csSDdLYEv4 =
68github.com/tetratelabs/wazero v1.8.2 /go.mod h1:yAI0XTsMBhREkM/YDAK/zNou3GoiAce1P6+rp/wQhjs =
79golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU =
You can’t perform that action at this time.
0 commit comments