constructive-history

Installation
SKILL.md

Constructive History

Per-row version history at every layer — database trigger, GraphQL API, and SDK. Two pieces compose:

  • DataHistory — a blueprint node that creates an append-only <table>_history companion. Every INSERT/UPDATE/DELETE on the source row appends a version row via an AFTER trigger (NEW-append: INSERT/UPDATE store the new row, DELETE stores a tombstone). The history table copies the source columns as plain nullable columns with no keys or constraints, plus a recorded_at timestamp and a history_op marker. Optionally range-partitioned by recorded_at (pg_partman) with a retention window so history is kept for a while — not forever.
  • graphile-history — the PostGraphile v5 plugin that discovers @history-tagged tables and adds version reads (history, versionAt, versionsBetween) and a restore<Table>Version mutation, all enforced under the caller's RLS.

When to Apply

Use this skill when:

  • Adding an audit/version log to a table (who-changed-what-when)
  • Querying a row as it looked at a past instant (point-in-time / as-of reads)
  • Listing every version of a row within a time window
  • Rolling a row back to a previous version (restore/revert)
  • Configuring history retention / partitioning so old versions age out

DataHistory Blueprint Node

Installs
2
First Seen
10 days ago
constructive-history — constructive-io/constructive-skills