set up plugins

This commit is contained in:
mungai-njoroge
2023-11-03 16:15:21 +03:00
parent a3281300d0
commit 72947203fa
15 changed files with 432 additions and 19 deletions
-16
View File
@@ -3,7 +3,6 @@ This module contains the functions to interact with the SQLite database.
"""
import sqlite3
from pathlib import Path
from sqlite3 import Connection as SqlConn
@@ -19,19 +18,4 @@ def create_tables(conn: SqlConn, sql_query: str):
"""
Executes the specifiend SQL file to create database tables.
"""
# with open(sql_query, "r", encoding="utf-8") as sql_file:
conn.executescript(sql_query)
def setup_search_db():
"""
Creates the search database.
"""
db = sqlite3.connect(":memory:")
sql_file = "queries/fts5.sql"
current_path = Path(__file__).parent.resolve()
sql_path = current_path.joinpath(sql_file)
with open(sql_path, "r", encoding="utf-8") as sql_file:
db.executescript(sql_file.read())