Changed connection behavior so you can target columns by their name

This commit is contained in:
Frisk 2020-07-27 14:01:12 +02:00
parent 734f835dbc
commit 49b9e8de20
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC
2 changed files with 2 additions and 1 deletions

View file

@ -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

View file

@ -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()