From 5d578c5b794976e0b74d69e6572ffac1eea47b15 Mon Sep 17 00:00:00 2001 From: James R Miller Date: Wed, 14 Aug 2019 17:55:06 -0500 Subject: [PATCH] added sqlite pragmas to speed up spells.py --- data/third_party_json/spells.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/data/third_party_json/spells.py b/data/third_party_json/spells.py index 35c34fb..957a890 100644 --- a/data/third_party_json/spells.py +++ b/data/third_party_json/spells.py @@ -29,6 +29,15 @@ def main(): ## Get database connection conn = sqlite3.connect('../../pf2.db') + ## Set pragmas + pragma1 = "PRAGMA synchronous=OFF;" + pragma2 = "PRAGMA count_changes=OFF;" + pragma3 = "PRAGMA journal_mode=MEMORY;" + pragma4 = "PRAGMA temp_store=MEMORY;" + conn.execute(pragma1) + conn.execute(pragma2) + conn.execute(pragma3) + conn.execute(pragma4) # load in ids for traits from traits table so we only call this once # instead of every spell