rangeEvery entity whose kind fact carries the value range — one row per entity, pivoted from the facts table at HEAD.
This page calls Snapshot.entitiesOfKind(range), which builds:
WITH kinds AS (
SELECT entity, MIN(asserted_at) AS created_at, ... AS created_by
FROM facts
WHERE attribute = 'kind' AND value = 'range'
GROUP BY entity
)
SELECT k.entity, k.created_at, k.created_by,
MAX(CASE WHEN cf.attribute='<attr>' THEN cf.value END) AS "<attr>",
...
FROM kinds k
LEFT JOIN current_facts cf ON cf.entity = k.entity
GROUP BY k.entity
HAVING "tombstoned" IS NULL
ORDER BY k.entity DESC
| id | created_at | created_by | attrs | status |
|---|---|---|---|---|
01KSQH918VJNBR7509D2S3R5ZE |
participant:01KSJHM69VCEB59WTFA1D5XYBZ
|
8 |