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 1
1
# Embeddable Wasm build of SQLite
2
2
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
4
5
[ ` BEGIN CONCURRENT ` ] ( https://sqlite.org/src/doc/begin-concurrent/doc/begin_concurrent.md ) and
5
6
[ Wal2] ( https://sqlite.org/cgi/src/doc/wal2/doc/wal2.md ) patches.
6
7
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
+
7
13
> [ !IMPORTANT]
8
14
> This package is experimental.
9
15
> 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.
11
17
12
18
> [ !CAUTION]
13
19
> The Wal2 journaling mode creates databases that other versions of SQLite cannot access.
Original file line number Diff line number Diff line change 5
5
"testing"
6
6
7
7
"github.com/ncruces/go-sqlite3/driver"
8
+ "github.com/ncruces/go-sqlite3/ext/stats"
8
9
"github.com/ncruces/go-sqlite3/vfs"
9
10
)
10
11
@@ -15,7 +16,7 @@ func Test_bcw2(t *testing.T) {
15
16
16
17
tmp := filepath .ToSlash (filepath .Join (t .TempDir (), "test.db" ))
17
18
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 )
19
20
if err != nil {
20
21
t .Fatal (err )
21
22
}
@@ -37,6 +38,11 @@ func Test_bcw2(t *testing.T) {
37
38
t .Fatal (err )
38
39
}
39
40
41
+ _ , err = tx .Exec (`SELECT median() WITHIN GROUP (ORDER BY col) FROM test` )
42
+ if err != nil {
43
+ t .Fatal (err )
44
+ }
45
+
40
46
err = tx .Commit ()
41
47
if err != nil {
42
48
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
18
18
19
19
cd sqlite
20
20
if [[ " $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 "
22
22
else
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
24
25
fi
25
26
cd ~ -
26
27
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ require github.com/ncruces/go-sqlite3 v0.21.3
8
8
9
9
require (
10
10
github.com/ncruces/julianday v1.0.0 // indirect
11
+ github.com/ncruces/sort v0.1.2 // indirect
11
12
github.com/tetratelabs/wazero v1.8.2 // indirect
12
13
golang.org/x/sys v0.29.0 // indirect
13
14
)
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
2
2
github.com/ncruces/go-sqlite3 v0.21.3 /go.mod h1:zxMOaSG5kFYVFK4xQa0pdwIszqxqJ0W0BxBgwdrNjuA =
3
3
github.com/ncruces/julianday v1.0.0 h1:fH0OKwa7NWvniGQtxdJRxAgkBMolni2BjDHaWTxqt7M =
4
4
github.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 =
5
7
github.com/tetratelabs/wazero v1.8.2 h1:yIgLR/b2bN31bjxwXHD8a3d+BogigR952csSDdLYEv4 =
6
8
github.com/tetratelabs/wazero v1.8.2 /go.mod h1:yAI0XTsMBhREkM/YDAK/zNou3GoiAce1P6+rp/wQhjs =
7
9
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU =
You can’t perform that action at this time.
0 commit comments