Documentation
¶
Overview ¶
Package foundation carries the schema runtime's own tables need.
Two migrations. rig_idempotency is the record of a write that carried an Idempotency-Key, so that a client which had to send the same write twice gets one row and the same answer both times. rig_throttle is how many calls one caller has made inside one window, which is the half of rate limiting that cannot be read back out of an audit trail.
It is the one set that references nothing. An idempotency record is useful in a project with no authentication and no files, and it is worth having before rig_tenant exists — so like rig_file it carries a tenant_id with no foreign key on it, and unlike every other set it can be applied on its own.
It lives under runtime rather than in a module of its own because runtime is what every generated application already imports, and a table the generated handlers write to should not be a fourth dependency to take on. The cost is that runtime, which is meant to stay small, now carries SQL; the alternative was a module whose whole content is one table.
The set is append-only — see github.com/simonjanss/rig/runtime/dbschema for what that means and why.
Index ¶
Constants ¶
const Table = "rig_runtime_migrations"
Table is where this set records how far it has been applied. Its own table, so that runtime can be released without agreeing a migration number with auth, files or notify.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.