dyna-record
    Preparing search index...

    Interface CreateOperationOptions<T>

    Options for DynaRecord.create.

    // Place an Order only for an active Customer at an open Store
    const options: CreateOperationOptions<Order> = {
    condition: {
    customer: { status: "active" },
    storeId: { target: { status: "open" } }
    }
    };
    interface CreateOperationOptions<T extends default = default> {
        condition?: CreateCondition<T>;
        referentialIntegrityCheck?: boolean;
    }

    Type Parameters

    Index

    Properties

    condition?: CreateCondition<T>

    Guards on the rows the new entity references, checked in the same transaction as the create: the entity is created only if every guard holds. The keys are the entity's BelongsTo relationships and its other foreign keys declared with their target type; the new row's own attributes take no condition. A guard still requires its row to exist when referentialIntegrityCheck is false. See CreateCondition.

    referentialIntegrityCheck?: boolean

    Whether to perform referential integrity checks for foreign key references. When true (default), condition checks are added to verify that referenced entities exist. When false, these condition checks are skipped, allowing creation even if foreign key references don't exist.

    true