aboutsummaryrefslogtreecommitdiff
path: root/todo/database.py
diff options
context:
space:
mode:
authorJoris2020-06-06 17:44:26 +0200
committerJoris2020-06-06 19:54:03 +0200
commit1595e0de940a86a7810df0e02e43838d97c0d846 (patch)
tree9701eeec0d98baa9f6044b1911df68e4c8539819 /todo/database.py
parent6b9195000eb5404c247288b384d7ca2bacc1ab23 (diff)
downloadtodo-1595e0de940a86a7810df0e02e43838d97c0d846.tar.gz
todo-1595e0de940a86a7810df0e02e43838d97c0d846.tar.bz2
todo-1595e0de940a86a7810df0e02e43838d97c0d846.zip
Provide nix build
Diffstat (limited to 'todo/database.py')
-rw-r--r--todo/database.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/todo/database.py b/todo/database.py
new file mode 100644
index 0000000..b571e88
--- /dev/null
+++ b/todo/database.py
@@ -0,0 +1,19 @@
+import todo.db.init
+
+_database = None
+
+def init(path):
+ global _database
+ _database = todo.db.init.init(path)
+
+def cursor():
+ global _database
+ return _database.cursor()
+
+def commit():
+ global _database
+ _database.commit()
+
+def close():
+ global _database
+ _database.close()