mate.db wird erstellt, wenn nicht existent

This commit is contained in:
2000-Trek 2023-09-20 18:50:35 +02:00
parent f06a78d118
commit bf44885ec9

View file

@ -1,3 +1,4 @@
from re import M
import sqlite3 import sqlite3
import click import click
@ -6,6 +7,13 @@ from flask import current_app, g
def get_db(): def get_db():
if 'db' not in g: if 'db' not in g:
try:
g.db = sqlite3.connect(
current_app.config['DATABASE'],
detect_types=sqlite3.PARSE_DECLTYPES
)
except:
init_db()
g.db = sqlite3.connect( g.db = sqlite3.connect(
current_app.config['DATABASE'], current_app.config['DATABASE'],
detect_types=sqlite3.PARSE_DECLTYPES detect_types=sqlite3.PARSE_DECLTYPES