Skip to main content

Module laboratory_attachments

Module laboratory_attachments 

Source
Expand description

Laboratory IDs attached to an agent target, backed by the postgres laboratory_attachments table.

A row attaches one laboratory_id to EITHER an agent_instance_hierarchy (AIH) OR a tag — never both (a CHECK constraint enforces exclusivity). A given laboratory is attached at most once per target (a partial unique index per target column). laboratory_id is an opaque external identifier.

Enums§

Target
Which target column a row is keyed on.

Functions§

attach
Attach laboratory_id to target. Returns true if a row was inserted, false if it was already attached. Caller holds the agent lock, so the select-then-insert is race-free.
detach
Detach laboratory_id from target. Returns true if a row was deleted, false if there was nothing to delete. Caller holds the agent lock.
list
All laboratory ids attached to target, oldest-attached first.