mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-13 01:36:15 +02:00
06d3d7355d
* Open all database tables (Db objects) at initialisation time, not every time they are used. This is necessary because tables have to outlive all transactions that refer to them.
32 lines
524 B
C++
32 lines
524 B
C++
#include "globals.hh"
|
|
#include "db.hh"
|
|
|
|
|
|
Database nixDB;
|
|
|
|
|
|
TableId dbPath2Id;
|
|
TableId dbId2Paths;
|
|
TableId dbSuccessors;
|
|
TableId dbSubstitutes;
|
|
|
|
|
|
string nixStore = "/UNINIT";
|
|
string nixDataDir = "/UNINIT";
|
|
string nixLogDir = "/UNINIT";
|
|
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()
|
|
{
|
|
}
|