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.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/globals.cc b/src/globals.cc
index 8c3ec38283ec..1ec0c4f9ba21 100644
--- a/src/globals.cc
+++ b/src/globals.cc
@@ -5,10 +5,10 @@
 Database nixDB;
 
 
-string dbPath2Id = "path2id";
-string dbId2Paths = "id2paths";
-string dbSuccessors = "successors";
-string dbSubstitutes = "substitutes";
+TableId dbPath2Id;
+TableId dbId2Paths;
+TableId dbSuccessors;
+TableId dbSubstitutes;
 
 
 string nixStore = "/UNINIT";
@@ -20,13 +20,13 @@ string nixDBPath = "/UNINIT";
 void openDB()
 {
     nixDB.open(nixDBPath);
+    dbPath2Id = nixDB.openTable("path2id");
+    dbId2Paths = nixDB.openTable("id2paths");
+    dbSuccessors = nixDB.openTable("successors");
+    dbSubstitutes = nixDB.openTable("substitutes");
 }
 
 
 void initDB()
 {
-    nixDB.createTable(dbPath2Id);
-    nixDB.createTable(dbId2Paths);
-    nixDB.createTable(dbSuccessors);
-    nixDB.createTable(dbSubstitutes);
 }