mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 16:26:18 +02:00
Eval cache: Don't replace real attributes with placeholders
This commit is contained in:
parent
69cb9f7eee
commit
3738bcb05e
1 changed files with 6 additions and 4 deletions
|
@ -693,6 +693,7 @@ struct AttrDb
|
||||||
{
|
{
|
||||||
SQLite db;
|
SQLite db;
|
||||||
SQLiteStmt insertAttribute;
|
SQLiteStmt insertAttribute;
|
||||||
|
SQLiteStmt insertPlaceholder;
|
||||||
SQLiteStmt queryAttribute;
|
SQLiteStmt queryAttribute;
|
||||||
SQLiteStmt queryAttributes;
|
SQLiteStmt queryAttributes;
|
||||||
std::unique_ptr<SQLiteTxn> txn;
|
std::unique_ptr<SQLiteTxn> txn;
|
||||||
|
@ -722,6 +723,9 @@ struct AttrDb
|
||||||
state->insertAttribute.create(state->db,
|
state->insertAttribute.create(state->db,
|
||||||
"insert or replace into Attributes(parent, name, type, value) values (?, ?, ?, ?)");
|
"insert or replace into Attributes(parent, name, type, value) values (?, ?, ?, ?)");
|
||||||
|
|
||||||
|
state->insertPlaceholder.create(state->db,
|
||||||
|
fmt("insert or ignore into Attributes(parent, name, type) values (?, ?, %d)", Placeholder));
|
||||||
|
|
||||||
state->queryAttribute.create(state->db,
|
state->queryAttribute.create(state->db,
|
||||||
"select rowid, type, value from Attributes where parent = ? and name = ?");
|
"select rowid, type, value from Attributes where parent = ? and name = ?");
|
||||||
|
|
||||||
|
@ -758,11 +762,9 @@ struct AttrDb
|
||||||
assert(rowId);
|
assert(rowId);
|
||||||
|
|
||||||
for (auto & attr : attrs)
|
for (auto & attr : attrs)
|
||||||
state->insertAttribute.use()
|
state->insertPlaceholder.use()
|
||||||
(rowId)
|
(rowId)
|
||||||
(attr)
|
(attr).exec();
|
||||||
(AttrType::Placeholder)
|
|
||||||
(0, false).exec();
|
|
||||||
|
|
||||||
return rowId;
|
return rowId;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue