writeRowInTransaction(statement: InStatement,existingId: number | null,persist: (tx: TxScope,id: number,) => Promise<void>,): Promise<number>
Write one row statement in a fresh write transaction and run persist (the
coupled join-table writes) on the same tx, so the row and its side writes
commit or roll back together. Returns the row id — existingId on update, or
the INSERT's lastInsertRowid on create (existingId null). Shared by the
REST resource (HTML forms) and CRUD API write paths.
persist: (tx: TxScope,id: number,) => Promise<void>