diff options
Diffstat (limited to 'src/home/database/sqlite.py')
-rw-r--r-- | src/home/database/sqlite.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/home/database/sqlite.py b/src/home/database/sqlite.py index a3a1664..bfba929 100644 --- a/src/home/database/sqlite.py +++ b/src/home/database/sqlite.py @@ -13,14 +13,16 @@ class SQLiteBase: SCHEMA = 1 def __init__(self, name=None, dbname='bot', check_same_thread=False): - if not name: - name = config.app_name - if not dbname: - dbname = name + db_path = config.get('db_path', default=None) + if db_path is None: + if not name: + name = config.app_name + if not dbname: + dbname = name + db_path = _get_database_path(name, dbname) self.logger = logging.getLogger(self.__class__.__name__) - self.sqlite = sqlite3.connect(_get_database_path(name, dbname), - check_same_thread=check_same_thread) + self.sqlite = sqlite3.connect(db_path, check_same_thread=check_same_thread) if is_development_mode(): self.sql_logger = logging.getLogger(self.__class__.__name__) |