prorm API Reference
    Preparing search index...

    Interface UpsertOptions

    Options for an insert-or-update, including which columns decide whether a row already exists.

    interface UpsertOptions {
        include?: IncludeOptions[] | Includeable[];
        ignoreDuplicates?: boolean;
        isNewRecord?: boolean;
        limit?: number;
        sideEffects?: boolean;
        omitNull?: boolean;
        individualHooks?: boolean;
        benchmark?: boolean;
        logging?: boolean | ((sql: string, time?: number) => void);
        using?: string;
        conflictFields?: string[];
        updateOnDuplicate?: string[];
        returning?: boolean | string[];
        raw?: boolean;
        fields?: string[];
        hooks?: boolean;
        validate?: boolean;
        transaction?: Transaction;
        where?: WhereOptions<any>;
        paranoid?: boolean;
    }

    Hierarchy (View Summary)

    Index
    include?: IncludeOptions[] | Includeable[]
    ignoreDuplicates?: boolean
    isNewRecord?: boolean
    limit?: number
    sideEffects?: boolean
    omitNull?: boolean
    individualHooks?: boolean
    benchmark?: boolean
    logging?: boolean | ((sql: string, time?: number) => void)
    using?: string

    Connection name to use for this query Allows querying a different database connection

    conflictFields?: string[]

    Fields to use for conflict resolution (ON CONFLICT for PostgreSQL/SQLite, ON DUPLICATE KEY for MySQL)

    updateOnDuplicate?: string[]

    Fields to update on conflict. If not specified, all fields will be updated

    returning?: boolean | string[]

    Whether to return the record after upsert

    raw?: boolean

    Use raw values instead of instances

    fields?: string[]

    Fields to include in the returned record

    hooks?: boolean

    Hooks configuration

    validate?: boolean

    Validate before upsert

    transaction?: Transaction

    Transaction to use

    where?: WhereOptions<any>

    Where clause for upsert (optional, can use primary key in values instead)

    paranoid?: boolean

    Whether to use paranoid mode when fetching the instance after upsert