Help us shape the future of Go! Take the 2026 Go Developer Survey

foundation

package
v0.6.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 2 Imported by: 0

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

View Source
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

func Set

func Set() dbschema.Set

Set is the runtime module's migrations, in the order they apply.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL