Browse Source

[db] connection module

Maxime Alves LIRMM@home 4 years ago
parent
commit
bac44de878
1 changed files with 9 additions and 0 deletions
  1. 9
    0
      db/db.py

+ 9
- 0
db/db.py View File

@@ -0,0 +1,9 @@
1
+#!/usr/bin/env python3
2
+import sqlite3
3
+from ..conf import config
4
+
5
+conn = sqlite3.connect(config['heatpump']['database'])
6
+
7
+def sql(query):
8
+    global conn
9
+    return conn.execute(query)

Loading…
Cancel
Save