From 34df5fc6eea2dddfb835200c2ff6cd8a2d01d181 Mon Sep 17 00:00:00 2001 From: Moon Date: Thu, 12 Jun 2025 12:57:01 +0900 Subject: [PATCH] small fix to use the configured db instead of hardcoded. --- db.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/db.py b/db.py index 63d0b43..9ef9857 100644 --- a/db.py +++ b/db.py @@ -1,7 +1,13 @@ import sqlite3 +import configparser + +# Read config to get database location +config = configparser.ConfigParser() +config.read('config.ini') # Connect to SQLite database (or create it if it doesn't exist) -conn = sqlite3.connect('gacha_game.db') +db_path = config['application']['DatabaseLocation'] +conn = sqlite3.connect(db_path) cursor = conn.cursor() # Create tables