Skip to main content
Version: v10.0.0

TransactionRecord

A write as the outbox keeps it


Import
import { TransactionRecord } from "@hyper-fetch/db"

Preview​

type TransactionRecord = {
collection: string;
createdAt: number;
dependsOn: string[];
id: string;
key: RowKey;
op: MutationOperation;
sent: boolean;
temporaryKey?: boolean;
transaction?: { name: string; writes: TransactionWrite[] };
values: Record<string, unknown>;
}

Structure​

TransactionRecord
NameTypeDescription
collection
string
createdAt
number
dependsOn
string[]
id
string
key
RowKey
op
MutationOperation
sent
boolean

Set before the request goes out, so a restart sends it again with the same id

temporaryKey
boolean

The key is temporary until the server assigns one, so it is not sent

transaction
{ name: string; writes: TransactionWrite[] }

A named transaction: its writes go out through the transaction's mutationFn , as one request

values
Record<string, unknown>