Skip to content

Commit 7797c38

Browse files
zaniebgeofft
andauthored
Enable fts4, fts5, rtree, and geopoly in SQLite (#694)
And add some regression tests. Co-authored-by: Geoffrey Thomas <[email protected]>
1 parent 62461bd commit 7797c38

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

cpython-unix/build-sqlite.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,19 @@ fi
2727
# it's not looked for.
2828
unset CXX
2929

30-
CC_FOR_BUILD="${HOST_CC}" CFLAGS="${EXTRA_TARGET_CFLAGS} -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS3_TOKENIZER -fPIC" CPPFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC" LDFLAGS="${EXTRA_TARGET_LDFLAGS}" ./configure ${CONFIGURE_FLAGS}
30+
CC_FOR_BUILD="${HOST_CC}" \
31+
CFLAGS="${EXTRA_TARGET_CFLAGS} \
32+
-DSQLITE_ENABLE_DBSTAT_VTAB \
33+
-DSQLITE_ENABLE_FTS3 \
34+
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
35+
-DSQLITE_ENABLE_FTS3_TOKENIZER \
36+
-DSQLITE_ENABLE_FTS4 \
37+
-DSQLITE_ENABLE_FTS5 \
38+
-DSQLITE_ENABLE_GEOPOLY \
39+
-DSQLITE_ENABLE_RTREE \
40+
-fPIC" \
41+
CPPFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC" \
42+
LDFLAGS="${EXTRA_TARGET_LDFLAGS}" ./configure ${CONFIGURE_FLAGS}
3143

3244
make -j ${NUM_CPUS} libsqlite3.a
3345
make install-lib DESTDIR=${ROOT}/out

src/verify_distribution.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,15 @@ def test_sqlite(self):
122122
self.assertTrue(hasattr(conn, "enable_load_extension"))
123123
# Backup feature requires modern SQLite, which we always have.
124124
self.assertTrue(hasattr(conn, "backup"))
125+
# Ensure that various extensions are present. These will raise
126+
# if they are not.
127+
cursor = conn.cursor()
128+
cursor.execute("CREATE VIRTUAL TABLE fts3 USING fts3(sender, title, body);")
129+
cursor.execute("CREATE VIRTUAL TABLE fts4 USING fts4(sender, title, body);")
130+
cursor.execute("CREATE VIRTUAL TABLE fts5 USING fts5(sender, title, body);")
131+
cursor.execute("CREATE VIRTUAL TABLE geopoly USING geopoly();")
132+
cursor.execute("CREATE VIRTUAL TABLE rtree USING rtree(id, minX, maxX);")
133+
conn.close()
125134

126135
def test_ssl(self):
127136
import ssl

0 commit comments

Comments
 (0)