mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-24 02:22:13 +08:00
22 lines
1.5 KiB
Diff
22 lines
1.5 KiB
Diff
--- src/core/database.cpp
|
|
+++ src/core/database.cpp
|
|
@@ -265,7 +265,17 @@
|
|
StaticInit();
|
|
|
|
{
|
|
- QSqlQuery set_fts_tokenizer(db);
|
|
+#ifdef SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
|
|
+ QVariant v = db.driver()->handle();
|
|
+ if (v.isValid() && qstrcmp(v.typeName(), "sqlite3*") == 0) {
|
|
+ sqlite3* handle = *static_cast<sqlite3**>(v.data());
|
|
+ if (handle) {
|
|
+ sqlite3_db_config(handle, SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, 1, NULL);
|
|
+ }
|
|
+ }
|
|
+#endif
|
|
+
|
|
+ QSqlQuery set_fts_tokenizer("SELECT fts3_tokenizer(:name, :pointer)", db);
|
|
set_fts_tokenizer.prepare("SELECT fts3_tokenizer(:name, :pointer)");
|
|
set_fts_tokenizer.bindValue(":name", "unicode");
|
|
set_fts_tokenizer.bindValue(
|