Resolve a reference
import { reference } from "nostrbase";
const target = reference("todos", "task-1", pubkey);
const record = await db.relations.resolve(target);
const related = await db.relations.resolveMany([target]);
A reference contains the table, record ID, and full author public key. Store it as JSON in another record. Resolution reads public tables through the normal query API. resolve() returns NOT_FOUND for a missing record; resolveMany() places null at each missing position and marks the result partial. Other failures remain errors. There is no server join, foreign key constraint, or automatic cascade delete.