Skip to content
On this page

@temporal

Temporal tables with current-row views and versioning triggers

Postgres Mysql (beta)

Example ​

Version rows over time ​

Adds validity columns, a current-row view, and trigger-based versioning.

sql
-- @temporal(view: 'accounts_current')
CREATE TABLE accounts (
  id SERIAL PRIMARY KEY,
  email TEXT NOT NULL
);

Tags ​

@temporal ​

Make this table temporal with valid_from/valid_to versioning (SCD Type 2)

Targets: table

Arguments:

NameTypeRequiredValues
viewstringNo—

Lint Rules ​

temporal.require-temporal ​

Tables should have a @temporal tag

Default severity: warn