Finish Pacosako + add GameStat table to know how many live games are played
[vchess.git] / server / db / dbconnect.py.dist
diff --git a/server/db/dbconnect.py.dist b/server/db/dbconnect.py.dist
new file mode 100644 (file)
index 0000000..9a86a19
--- /dev/null
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+
+import sqlite3
+from sqlite3 import Error
+
+vchess_db_path = "/path/to/vchess.sqlite"
+
+def create_connection():
+    """
+    Create a database connection to the vchess SQLite database
+    :return: Connection object or None
+    """
+
+    conn = None
+    try:
+        conn = sqlite3.connect(vchess_db_path)
+    except Error as e:
+        print(e)
+
+    return conn