aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/local-store.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/local-store.hh')
-rw-r--r--src/libstore/local-store.hh35
1 files changed, 13 insertions, 22 deletions
diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh
index f1e2ab7f9..877dba742 100644
--- a/src/libstore/local-store.hh
+++ b/src/libstore/local-store.hh
@@ -55,19 +55,8 @@ private:
/* The SQLite database object. */
SQLite db;
- /* Some precompiled SQLite statements. */
- SQLiteStmt stmtRegisterValidPath;
- SQLiteStmt stmtUpdatePathInfo;
- SQLiteStmt stmtAddReference;
- SQLiteStmt stmtQueryPathInfo;
- SQLiteStmt stmtQueryReferences;
- SQLiteStmt stmtQueryReferrers;
- SQLiteStmt stmtInvalidatePath;
- SQLiteStmt stmtAddDerivationOutput;
- SQLiteStmt stmtQueryValidDerivers;
- SQLiteStmt stmtQueryDerivationOutputs;
- SQLiteStmt stmtQueryPathFromHashPart;
- SQLiteStmt stmtQueryValidPaths;
+ struct Stmts;
+ std::unique_ptr<Stmts> stmts;
/* The file to which we write our temporary roots. */
AutoCloseFD fdTempRoots;
@@ -90,7 +79,7 @@ private:
std::unique_ptr<PublicKeys> publicKeys;
};
- Sync<State, std::recursive_mutex> _state;
+ Sync<State> _state;
public:
@@ -138,7 +127,7 @@ public:
StorePathSet queryValidDerivers(const StorePath & path) override;
- std::map<std::string, std::optional<StorePath>> queryPartialDerivationOutputMap(const StorePath & path) override;
+ std::map<std::string, std::optional<StorePath>> queryDerivationOutputMapNoResolve(const StorePath & path) override;
std::optional<StorePath> queryPathFromHashPart(const std::string & hashPart) override;
@@ -219,6 +208,13 @@ public:
garbage until it exceeds maxFree. */
void autoGC(bool sync = true);
+ /* Register the store path 'output' as the output named 'outputName' of
+ derivation 'deriver'. */
+ void registerDrvOutput(const Realisation & info) override;
+ void cacheDrvOutputMapping(State & state, const uint64_t deriver, const string & outputName, const StorePath & output);
+
+ std::optional<const Realisation> queryRealisation(const DrvOutput&) override;
+
private:
int getSchema();
@@ -287,17 +283,12 @@ private:
specified by the ‘secret-key-files’ option. */
void signPathInfo(ValidPathInfo & info);
- /* Register the store path 'output' as the output named 'outputName' of
- derivation 'deriver'. */
- void linkDeriverToPath(const StorePath & deriver, const string & outputName, const StorePath & output);
- void linkDeriverToPath(State & state, uint64_t deriver, const string & outputName, const StorePath & output);
-
Path getRealStoreDir() override { return realStoreDir; }
void createUser(const std::string & userName, uid_t userId) override;
- friend class DerivationGoal;
- friend class SubstitutionGoal;
+ friend struct DerivationGoal;
+ friend struct SubstitutionGoal;
};