prorm API Reference
    Preparing search index...

    Interface UpsertQueryOptions

    Options for an insert-or-update, including which columns decide whether a row already exists and which are written on conflict.

    interface UpsertQueryOptions {
        conflictFields?: string[];
        schema?: string;
        updateOnDuplicate?: string[];
        returning?: boolean | string[];
        model?: any;
    }
    Index
    conflictFields?: string[]

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

    schema?: string

    Schema to use for the table

    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

    model?: any

    Model raw attributes for type casting