set synchronous and foreign_keys on startup

This commit is contained in:
Infinidoge 2024-12-31 14:08:33 -05:00
parent 08c4187d70
commit 5390181cfa
Signed by: Infinidoge
SSH key fingerprint: SHA256:GT2StvPQMMfFHyiiFJymQxfTG/z6EWLJ6NWItf5K5sA

View file

@ -12,9 +12,6 @@ log.setLevel(logging.INFO)
schema = """ schema = """
PRAGMA user_version = 1; PRAGMA user_version = 1;
PRAGMA main.synchronous = NORMAL;
PRAGMA foreign_keys = ON;
CREATE TABLE keywords ( CREATE TABLE keywords (
guild_id INTEGER NOT NULL, guild_id INTEGER NOT NULL,
keyword TEXT NOT NULL, keyword TEXT NOT NULL,
@ -80,6 +77,8 @@ async def setup_db(db_file):
log.debug("Running start script") log.debug("Running start script")
await db.executescript(""" await db.executescript("""
PRAGMA optimize(0x10002); PRAGMA optimize(0x10002);
PRAGMA main.synchronous = NORMAL;
PRAGMA foreign_keys = ON;
""") """)
log.debug("Adding contains function") log.debug("Adding contains function")