writeRowInTransaction<State = never>(statement: InStatement,existingId: number | null,persist: () => Promise<void>,readState?: TransactionStateReader<State>,): 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. On update, an optional readState runs before
the statement and its result reaches persist; creates skip it. Returns the
row id — existingId on update, or the key the INSERT returned on create.
optional
readState: TransactionStateReader<State>