[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Ricardo Wurmus |
Date: |
Wed, 30 Oct 2019 08:02:13 -0400 (EDT) |
branch: master
commit 8a618322b12436dac6034817c596aa9fd433dd8d
Author: Ricardo Wurmus <address@hidden>
Date: Wed Oct 30 09:19:28 2019 +0100
database: Add db-remove-specification.
* src/cuirass/database.scm (db-remove-specification): New procedure.
---
src/cuirass/database.scm | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 8db5411..523165d 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -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
- master updated (80b6e89 -> 647f396), Ricardo Wurmus, 2019/10/30
- [no subject], Ricardo Wurmus, 2019/10/30
- [no subject], Ricardo Wurmus, 2019/10/30
- [no subject],
Ricardo Wurmus <=
- [no subject], Ricardo Wurmus, 2019/10/30
- [no subject], Ricardo Wurmus, 2019/10/30
- [no subject], Ricardo Wurmus, 2019/10/30