diff options
author | Marius Bakke <mbakke@fastmail.com> | 2018-12-11 22:18:05 +0100 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2018-12-11 22:18:05 +0100 |
commit | b03e4fd5269897448124a7b61a737802b2c638ee (patch) | |
tree | e4eaab1d3076e335c57eea462ff7fda7919f0831 /guix/store/database.scm | |
parent | da3c6a7f19ef1243af725f63c16c8fd92fde33b4 (diff) | |
parent | 99aad42138e0895df51e64e1261984f277952516 (diff) | |
download | guix-patches-b03e4fd5269897448124a7b61a737802b2c638ee.tar guix-patches-b03e4fd5269897448124a7b61a737802b2c638ee.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/store/database.scm')
-rw-r--r-- | guix/store/database.scm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/guix/store/database.scm b/guix/store/database.scm index 341276bc30..e6bfbe763e 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 @@ -51,7 +53,7 @@ (define sqlite-exec ;; XXX: This is was missing from guile-sqlite3 until - ;; <https://notabug.org/civodul/guile-sqlite3/commit/b87302f9bcd18a286fed57b2ea521845eb1131d7>. + ;; <https://notabug.org/guile-sqlite3/guile-sqlite3/commit/b87302f9bcd18a286fed57b2ea521845eb1131d7>. (let ((exec (pointer->procedure int (dynamic-func "sqlite3_exec" (@@ (sqlite3) libsqlite3)) @@ -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." |