database: Add db-remove-specification.
* src/cuirass/database.scm (db-remove-specification): New procedure.
This commit is contained in:
parent
c88a7c006e
commit
8a618322b1
|
@ -38,6 +38,7 @@
|
|||
db-open
|
||||
db-close
|
||||
db-add-specification
|
||||
db-remove-specification
|
||||
db-get-specifications
|
||||
db-add-evaluation
|
||||
db-set-evaluations-done
|
||||
|
@ -332,6 +333,16 @@ package_path_inputs, proc_input, proc_file, proc, proc_args) \
|
|||
(assq-ref spec #:inputs))
|
||||
spec-id)))
|
||||
|
||||
(define (db-remove-specification name)
|
||||
"Remove the specification matching NAME from the database and its inputs."
|
||||
(with-db-critical-section db
|
||||
(sqlite-exec db "BEGIN TRANSACTION;")
|
||||
(sqlite-exec db "\
|
||||
DELETE FROM Inputs WHERE specification=" name ";")
|
||||
(sqlite-exec db "\
|
||||
DELETE FROM Specifications WHERE name=" name ";")
|
||||
(sqlite-exec db "COMMIT;")))
|
||||
|
||||
(define (db-get-inputs spec-name)
|
||||
(with-db-critical-section db
|
||||
(let loop ((rows (sqlite-exec
|
||||
|
|
Loading…
Reference in New Issue