diff options
author | Ludovic Courtès <ludo@gnu.org> | 2018-11-13 09:46:40 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2018-11-13 14:59:45 +0100 |
commit | 1afe1985f5bffef76872f4c9e87115b46a4a3d47 (patch) | |
tree | 79bd452895b477a5ec3ec3b5aa12c763cf7160cf /guix/store | |
parent | 155956449af6d42cdf739b0922b34bdaae639aa7 (diff) |
nar: Access the database instead of connecting to the daemon.
* guix/store/database.scm (%default-database-file): New variable.
(path-id): Export.
* guix/nar.scm (finalize-store-file): Use 'with-database' instead of
'with-store', and use 'path-id' instead of 'valid-path?'.
Diffstat (limited to 'guix/store')
-rw-r--r-- | guix/store/database.scm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/guix/store/database.scm b/guix/store/database.scm index 341276bc30..38796910da 100644 --- a/guix/store/database.scm +++ b/guix/store/database.scm @@ -36,7 +36,9 @@ #:use-module (ice-9 match) #:use-module (system foreign) #:export (sql-schema + %default-database-file with-database + path-id sqlite-register register-path register-items @@ -85,6 +87,10 @@ create it and initialize it as a new database." (lambda () (sqlite-close db))))) +(define %default-database-file + ;; Default location of the store database. + (string-append %store-database-directory "/db.sqlite")) + (define-syntax-rule (with-database file db exp ...) "Open DB from FILE and close it when the dynamic extent of EXP... is left. If FILE doesn't exist, create it and initialize it as a new database." |