From 49b9e8de208953c573e0963f983be4541746c76e Mon Sep 17 00:00:00 2001 From: Frisk Date: Mon, 27 Jul 2020 14:01:12 +0200 Subject: [PATCH] Changed connection behavior so you can target columns by their name --- src/bot.py | 2 +- src/database.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bot.py b/src/bot.py index c5a8fe2..e44bd8c 100644 --- a/src/bot.py +++ b/src/bot.py @@ -60,7 +60,7 @@ async def wiki_scanner(): extended = False if db_wiki[1] not in all_wikis: logger.debug("New wiki: {}".format(db_wiki[1])) - all_wikis[db_wiki[1]] = Wiki() + all_wikis[db_wiki["wiki"]] = Wiki() local_wiki = all_wikis[db_wiki[1]] # set a reference to a wiki object from memory if local_wiki.mw_messages is None: extended = True diff --git a/src/database.py b/src/database.py index 5673d66..4366668 100644 --- a/src/database.py +++ b/src/database.py @@ -2,4 +2,5 @@ import sqlite3 from src.config import settings db_connection = sqlite3.connect(settings.get("database_path", 'rcgcdb.db')) +db_connection.row_factory = sqlite3.Row db_cursor = db_connection.cursor()