File tree Expand file tree Collapse file tree 3 files changed +426
-401
lines changed
com.oracle.graal.python.cext
com.oracle.graal.python.test/src/tests Expand file tree Collapse file tree 3 files changed +426
-401
lines changed Original file line number Diff line number Diff line change @@ -240,7 +240,19 @@ set(SQLITE3_SRC
240
240
"${SRC_DIR} /modules/_sqlite/util.c"
241
241
)
242
242
native_module ("_sqlite3" TRUE "${SQLITE3_SRC} " )
243
+ # This combines the flags CPython uses on macOS and Windows, on Linux systems
244
+ # it usually links against the system sqlite3 so we do not really know. See
245
+ # https://github.com/python/cpython/issues/88017 for some reasons
243
246
target_include_directories ("_sqlite3" PUBLIC "${SRC_DIR} /modules/_sqlite/sqlite" )
247
+ target_compile_definitions ("_sqlite3" PRIVATE
248
+ SQLITE_ENABLE_MATH_FUNCTIONS
249
+ SQLITE_ENABLE_FTS5
250
+ SQLITE_ENABLE_FTS4
251
+ SQLITE_ENABLE_FTS3_PARENTHESIS
252
+ SQLITE_ENABLE_RTREE
253
+ SQLITE_OMIT_AUTOINIT
254
+ SQLITE_TCL=0
255
+ )
244
256
245
257
set (LIBHACL_HEADERS
246
258
# "${SRC_DIR}/modules/_hacl/include/krml/FStar_UInt128_Verified.h"
Original file line number Diff line number Diff line change 1
- # Copyright (c) 2023, 2024 , Oracle and/or its affiliates. All rights reserved.
1
+ # Copyright (c) 2023, 2025 , Oracle and/or its affiliates. All rights reserved.
2
2
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3
3
#
4
4
# The Universal Permissive License (UPL), Version 1.0
@@ -49,3 +49,15 @@ def test_basic_functionality():
49
49
rows = conn .execute ("select sqlite_version()" )
50
50
assert len (next (rows )[0 ]) >= 5
51
51
conn .close ()
52
+
53
+
54
+ def test_fts5_works ():
55
+ import sqlite3
56
+ conn = sqlite3 .connect (':memory:' )
57
+ conn .execute ("CREATE VIRTUAL TABLE IF NOT EXISTS your_table USING fts5(column1, column2)" )
58
+ conn .execute ("CREATE VIRTUAL TABLE IF NOT EXISTS your_table USING fts4(column1, column2)" )
59
+ conn .execute ("CREATE VIRTUAL TABLE IF NOT EXISTS your_table USING fts3(column1, column2)" )
60
+ conn .execute ("CREATE VIRTUAL TABLE IF NOT EXISTS your_table USING rtree(column1, column2)" )
61
+ sqpi = next (conn .execute ("SELECT pi()" ))[0 ]
62
+ assert 3.14 == float (f'{ sqpi :.2f} ' ), sqpi
63
+ conn .close ()
You can’t perform that action at this time.
0 commit comments