Chron script for loading database
This commit is contained in:
@@ -12,6 +12,10 @@ Game = namedtuple('Game',
|
||||
|
||||
Link = namedtuple('Link', ['gameId', 'gameTitle', 'characterId', 'characterName'])
|
||||
|
||||
SET_WAL_PRAGMA = """
|
||||
PRAGMA journal_mode=WAL;
|
||||
"""
|
||||
|
||||
APPS_TABLE_CREATE = """
|
||||
CREATE TABLE IF NOT EXISTS "Apps" (
|
||||
"gameId" INTEGER,
|
||||
@@ -170,6 +174,7 @@ def loadAppsAndPicks(characterNameToId, gameTitleToId, gameFileName):
|
||||
def createTables(dbName):
|
||||
with sqlite3.connect(dbName) as connection:
|
||||
cursor = connection.cursor()
|
||||
cursor.execute(SET_WAL_PRAGMA)
|
||||
cursor.execute(CHARACTER_TABLE_CREATE)
|
||||
cursor.execute(GAMES_TABLE_CREATE)
|
||||
cursor.execute(APPS_TABLE_CREATE)
|
||||
|
||||
Reference in New Issue
Block a user