dyna-record
    Preparing search index...

    Type Alias WriteConditionGuard

    WriteConditionGuard:
        | { kind: "self" }
        | { id?: string; kind: "relationship"; name: string }
        | { kind: "foreignKey"; name: string }

    Identifies one consumer guard of a write condition, as listed in WriteConditionFailedError.guards:

    • self — the condition on the written entity's own row
    • relationship — a condition on a related entity's row, named by the relationship property, with the related entity's id for a HasMany or HasAndBelongsToMany entry
    • foreignKey — a target condition on the row a foreign key references, named by the foreign-key property. It carries no id: the referenced id is the foreign key's value
    const guards: WriteConditionGuard[] = [
    { kind: "self" },
    { kind: "relationship", name: "customer" },
    { kind: "relationship", name: "orders", id: "order-1" },
    { kind: "foreignKey", name: "storeId" }
    ];