current_fields

rank-1 field_values

What you'll learn

You're writing SQL that reads current_fields and need its columns, what each holds, and the DDL as the spec states it.

  • every column and its type
  • what the object holds and who writes it
  • the DDL as the spec states it

A view. rank-1 field_values — the current value per (identity, field), value still JSON-encoded.

Columns

identity_id, field, value, source, confidence, run_id, created_at.

Definition

From spec/ledger.sql, which is the machine-checkable form of SPEC.md §3:

CREATE VIEW current_fields AS
SELECT identity_id, field, value, source, confidence, run_id, created_at
FROM field_value_ranks
WHERE rank = 1;