PgInsert
interface PgInsert <TTable extends AnyPgTable, TQueryResult extends QueryResultHKT, TReturning extends Record<string, unknown> | undefined = undefined> extends QueryPromise<TReturning extends undefined ? QueryResultKind<TQueryResult, never> : TReturning[]>, SQLWrapper {}
class PgInsert<TTable extends AnyPgTable, TQueryResult extends QueryResultHKT, TReturning extends Record<string, unknown> | undefined = undefined> extends QueryPromise<TReturning extends undefined ? QueryResultKind<TQueryResult, never> : TReturning[]> implements SQLWrapper { }
private _prepare;
private config;
private dialect;
private session;
_: {
table: TTable;
return: TReturning;
};execute: ReturnType<this["prepare"]>["execute"];
onConflictDoUpdate(config: {
target: IndexColumn | IndexColumn[];
where?: SQL;
set: PgUpdateSetSource<TTable>;
}): this;prepare(name: string): PreparedQuery<PreparedQueryConfig & {
execute: TReturning extends undefined ? QueryResultKind<TQueryResult, never> : TReturning[];
}>;returning(): PgInsert<TTable, TQueryResult, InferModel<TTable>>;
returning<TSelectedFields extends SelectedFieldsFlat>(fields: TSelectedFields): PgInsert<TTable, TQueryResult, SelectResultFields<TSelectedFields>>;
§Extends
§
QueryPromise<TReturning extends undefined ? QueryResultKind<TQueryResult, never> : TReturning[]>
[src]§Extends
§
QueryPromise<TReturning extends undefined ? QueryResultKind<TQueryResult, never> : TReturning[]>
[src]§Implements
§Constructors
§
new PgInsert(table: TTable, values: PgInsertConfig["values"], session: PgSession, dialect: PgDialect)
[src]§Properties
§Methods
§
onConflictDoNothing(config?: {
[src]target?: IndexColumn | IndexColumn[];
where?: SQL;
}): this§
onConflictDoUpdate(config: {
[src]target: IndexColumn | IndexColumn[];
where?: SQL;
set: PgUpdateSetSource<TTable>;
}): this§
prepare(name: string): PreparedQuery<PreparedQueryConfig & {
[src]execute: TReturning extends undefined ? QueryResultKind<TQueryResult, never> : TReturning[];
}>§
returning(): PgInsert<TTable, TQueryResult, InferModel<TTable>>
[src]returning<TSelectedFields extends SelectedFieldsFlat>(fields: TSelectedFields): PgInsert<TTable, TQueryResult, SelectResultFields<TSelectedFields>>
[src]