dyna-record
    Preparing search index...

    Interface UntypedForeignKeyTargetError

    The error surface presented when a target guard is written on a foreign key declared without its target type.

    Never written by hand: it is the type a target takes on a bare ForeignKey, so the compile error on the guard quotes its message.

    A bare ForeignKey carries no compile-time link to the entity it references, so a guard on it could only be typed against attributes of the wrong entity. Adding the type parameter — ForeignKey<Customer> — is a non-breaking change that makes the guard available.

    class CustomerStore extends JoinTable<Customer, Store> {
    public readonly customerId: ForeignKey<Customer>;
    public readonly storeId: ForeignKey; // bare: no target type
    }

    await CustomerStore.create(
    { customerId: "customer-1", storeId: "store-1" },
    // Compile error naming this surface: declare storeId as ForeignKey<Store>
    { condition: { storeId: { target: { status: "open" } } } }
    );
    interface UntypedForeignKeyTargetError {
        __writeConditionError: "declare this foreign key with its target type, ForeignKey<Target> or NullableForeignKey<Target>, to guard the row it references";
    }
    Index

    Properties

    __writeConditionError: "declare this foreign key with its target type, ForeignKey<Target> or NullableForeignKey<Target>, to guard the row it references"