diff options
Diffstat (limited to 'app/database.py')
| -rw-r--r-- | app/database.py | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/app/database.py b/app/database.py deleted file mode 100644 index e23aa5d..0000000 --- a/app/database.py +++ /dev/null @@ -1,19 +0,0 @@ -import sqlite3 -from app import app -from flask import g - -# constants -DATABASE_FILE = "../strengthy.db" - -# Called when an "appcontext" is closed, usually a request is finished -@app.teardown_appcontext -def close_db_conn(exception): - db = getattr(g, '_database', None) - if db is not None: - db.close() - -def database_get(): - db = getattr(g, '_database', None) - if db is None: - db = g._database = sqlite3.connect(DATABASE_FILE) - return db |
