<T>(row: T | undefined, context?: string | undefined): T Assert that a row is present, throwing a descriptive error if missing.
Use after INSERT ... RETURNING queries where the database guarantees
a row is returned on success. Replaces bare row! non-null assertions
with an explicit runtime check.
row
the row from query_one (T | undefined) or rows[0] (T | undefined)
type
T | undefinedcontext?
optional context for the error message (e.g. table or operation name)
type
string | undefinedoptional
returns
T the row, guaranteed non-undefined