diff options
Diffstat (limited to 'guix-build-coordinator/datastore/sqlite.scm')
-rw-r--r-- | guix-build-coordinator/datastore/sqlite.scm | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm index 6af0b46..a66614a 100644 --- a/guix-build-coordinator/datastore/sqlite.scm +++ b/guix-build-coordinator/datastore/sqlite.scm @@ -532,19 +532,26 @@ INSERT INTO agent_tags (agent_id, tag_id) VALUES (:agent_id, :tag_id)" result)) + (define (insert-tag key value) + (sqlite-bind-arguments agent-tags-statement + #:agent_id agent-id + #:tag_id (tag->id key value)) + (sqlite-step agent-tags-statement) + (sqlite-reset agent-tags-statement)) + (sqlite-bind-arguments delete-agent-tags-statement #:agent_id agent-id) (sqlite-step delete-agent-tags-statement) (sqlite-reset delete-agent-tags-statement) (for-each (match-lambda - ((key . value) - (sqlite-bind-arguments agent-tags-statement - #:agent_id agent-id - #:tag_id (tag->id key value)) - (sqlite-step agent-tags-statement) - (sqlite-reset agent-tags-statement))) - tags)))) + ((('key . key) + ('value . value)) + (insert-tag key value)) + ((key . value) (insert-tag key value))) + (if (vector? tags) + (vector->list tags) + tags))))) #t) (define-method (datastore-store-derivation |