Every database statement from spec §10, one function each, as raw SQL.
All functions take the repo explicitly. The complete_* functions run the
outcome UPDATE and the consumed-signal DELETE in one transaction.
partition_key serialization (advisory lock) helpers live here too; the
caller is responsible for holding a single connection (Repo.checkout/1) for
the lock's lifetime.