guix-cuirass/src/sql
Christopher Baines 12def48b3b Support publishing build events
Add a table to store events, which have a type and a JSON blob. These can be
used to record changes, this commit inserts events when new builds are
created, and when the status of builds change.

The EventsOutbox table is then used to track when events have been sent
out. This is done through the new cuirass-send-events script.

* Makefile.am (bin_SCRIPTS): Add bin/cuirass-send-events.
.gitignore: Add bin/cuirass-send-events.
(dist_pkgmodule_DATA): Add src/cuirass/send-events.scm.
(dist_sql_DATA): Add src/sql/upgrade-5.sql.
(EXTRA_DIST): bin/cuirass-send-events.in.
(bin/cuirass-send-events): New rule.
* bin/cuirass-send-events.in: New file.
* src/cuirass/send-events.scm: New file.
* src/sql/upgrade-5.sql: New file.
* src/cuirass/database.scm (changes-count): New procedure.
(db-update-build-status!): Call db-add-event after updating the build status.
(db-add-event): New procedure.
(db-add-build): Insert an event when a new build is inserted.
(db-delete-events-with-ids-<=-to): New procedure.
* src/schema.sql (Events): New table.
2020-01-16 08:32:52 +00:00
..
upgrade-1.sql Add support for multiple inputs. 2018-07-16 21:33:14 +02:00
upgrade-2.sql database: Merge Derivations into Builds table. 2018-08-16 19:19:23 +02:00
upgrade-3.sql database: Add a Checkouts table. 2018-08-27 15:38:44 +02:00
upgrade-4.sql database: Add builds only if one of their outputs is new. 2018-09-29 22:29:06 +02:00
upgrade-5.sql Support publishing build events 2020-01-16 08:32:52 +00:00