about summary refs log tree commit diff
path: root/src/globals.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/globals.cc')
-rw-r--r--src/globals.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/globals.cc b/src/globals.cc
index 1edb38f7483e..8c3ec38283ec 100644
--- a/src/globals.cc
+++ b/src/globals.cc
@@ -2,6 +2,9 @@
 #include "db.hh"
 
 
+Database nixDB;
+
+
 string dbPath2Id = "path2id";
 string dbId2Paths = "id2paths";
 string dbSuccessors = "successors";
@@ -11,13 +14,19 @@ string dbSubstitutes = "substitutes";
 string nixStore = "/UNINIT";
 string nixDataDir = "/UNINIT";
 string nixLogDir = "/UNINIT";
-string nixDB = "/UNINIT";
+string nixDBPath = "/UNINIT";
+
+
+void openDB()
+{
+    nixDB.open(nixDBPath);
+}
 
 
 void initDB()
 {
-    createDB(nixDB, dbPath2Id);
-    createDB(nixDB, dbId2Paths);
-    createDB(nixDB, dbSuccessors);
-    createDB(nixDB, dbSubstitutes);
+    nixDB.createTable(dbPath2Id);
+    nixDB.createTable(dbId2Paths);
+    nixDB.createTable(dbSuccessors);
+    nixDB.createTable(dbSubstitutes);
 }