Skip to content

Commit fa68443

Browse files
committed
support using the sqlite3 from trunk rather than a released version
The build tag `sqlite_trunk` results in using `sqlite3_trunk.c` instead of `sqlite3.c`. The current `sqlite3_trunk.c` results from building the amalgamation from sqlite/sqlite@0f7f9ab using `configure --all`. `sqlite3.h` is still just the released version. Updates tailscale/corp#37997 Signed-off-by: Percy Wegmann <percy@tailscale.com>
1 parent fa58cbc commit fa68443

File tree

5 files changed

+267477
-4
lines changed

5 files changed

+267477
-4
lines changed

.github/workflows/test-sqlite.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ jobs:
3131

3232
- name: Race
3333
run: go test -v -race ./...
34-
35-
- name: Race with sqlite_enable_api_armor and sqlite_enable_tmstmpvfs
36-
run: go test -v -race -tags sqlite_enable_api_armor,sqlite_enable_tmstmpvfs
34+
- name: Race with sqlite_trunk, sqlite_enable_api_armor and sqlite_enable_tmstmpvfs
35+
run: go test -v -race -tags sqlite_trunk,sqlite_enable_api_armor,sqlite_enable_tmstmpvfs
3736

3837
- name: No CGO build
3938
run: CGO_ENABLED=0 go install ./...

cgosqlite/cgosqlite.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ package cgosqlite
88
// One exception is we do not use SQLITE_OMIT_DECLTYPE, as the design
99
// of the database/sql driver seems to require it.
1010
11+
#cgo !sqlite_trunk CFLAGS: -DSQLITE_RELEASE
12+
#cgo sqlite_trunk CFLAGS: -DSQLITE_TRUNK
1113
#cgo CFLAGS: -DSQLITE_THREADSAFE=2
1214
#cgo CFLAGS: -DSQLITE_DQS=0
1315
#cgo CFLAGS: -DSQLITE_DEFAULT_MEMSTATUS=0

cgosqlite/sqlite3.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#ifdef SQLITE_RELEASE
2+
13
/******************************************************************************
24
** This file is an amalgamation of many separate C source files from SQLite
35
** version 3.51.2. By combining all the individual C code files into this
@@ -265950,3 +265952,6 @@ SQLITE_API int sqlite3_stmt_init(
265950265952
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
265951265953
#endif /* SQLITE_AMALGAMATION */
265952265954
/************************** End of sqlite3.c ******************************/
265955+
265956+
265957+
#endif

0 commit comments

Comments
 (0)