import { DataSet } from '../DataSet'; import { HasTable } from './features'; import { Query } from './Query'; import { QueryTable } from './QueryTable'; /** * An "insert or update" statement (a.k.a. upsert), modelled after Eloquent's * `Model::upsert($values, $uniqueBy, $update)`: * * - `rows` one or more records to insert. * - `conflictColumns` the column(s) that detect a conflict (a unique or * primary key). On PostgreSQL/SQLite they drive the * `ON CONFLICT (...)` target; MySQL ignores them and * relies on its own unique keys. * - `updateColumns` the columns to overwrite when a conflict happens. When * omitted it defaults to every inserted column that is * not part of `conflictColumns` (Eloquent's behaviour). * * Engines differ on the exact syntax, so the SQL is produced by each * QueryBuilder (DefaultQueryBuilder for PostgreSQL/SQLite, MysqlQueryBuilder * for MySQL) rather than here. */ export declare class UpsertQuery extends Query { protected _rows: DataSet[]; protected _conflictColumns: string[]; protected _updateColumns?: string[]; constructor(table?: QueryTable); setRows(rows: DataSet[]): this; getRows(): DataSet[]; setConflictColumns(columns: string[]): this; getConflictColumns(): string[]; setUpdateColumns(columns: string[] | undefined): this; getUpdateColumns(): string[] | undefined; } export interface UpsertQuery extends HasTable { }