-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better sync fts Added Log Print into FTS Initializer Patch: update Virtual Table after user add data to the root table
- Loading branch information
1 parent
25bca14
commit 64bc7a7
Showing
4 changed files
with
19 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import sqlite3 | ||
|
||
from log.write import sys_log | ||
|
||
def Initializer_Virtual_Table(): | ||
conn = sqlite3.connect('./database/search-index.db') | ||
|
||
conn.execute('''CREATE VIRTUAL TABLE IF NOT EXISTS information_fts | ||
USING FTS5(site_id, link, title, text, description, keywords, shorttext, added)''') | ||
|
||
conn.close() | ||
|
||
sys_log("Initializer Virtual Table", "search-index.db") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import sqlite3 | ||
|
||
def Update_Virtual_Table(): | ||
conn = sqlite3.connect('./database/search-index.db') | ||
from log.write import sys_log | ||
|
||
def Update_Virtual_Table(conn): | ||
conn.execute('DELETE FROM information_fts') | ||
conn.execute('''INSERT INTO information_fts(site_id, link, title, text, description, keywords, shorttext, added) | ||
SELECT site_id, link, title, text, description, keywords, shorttext, added FROM information''') | ||
|
||
conn.commit() | ||
|
||
conn.close() | ||
sys_log("Update Virtual Table", "search-index.db") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters