Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/drizzle/pg-core.ts>PgInsert

Deno port of the drizzle-orm library
Latest
class PgInsert
implements SQLWrapper
extends QueryPromise<TReturning extends undefined ? QueryResultKind<TQueryResult, never> : TReturning[]>
import { PgInsert } from "https://deno.land/x/drizzle@v0.23.85/pg-core.ts";

Constructors

new
PgInsert(
table: TTable,
values: PgInsertConfig["values"],
session: PgSession,
dialect: PgDialect,
)

Type Parameters

TTable extends AnyPgTable
TQueryResult extends QueryResultHKT
optional
TReturning extends Record<string, unknown> | undefined = undefined

Properties

private
_prepare
private
config
private
dialect
private
session
_: { table: TTable; return: TReturning; }
execute: ReturnType<this["prepare"]>["execute"]

Methods

onConflictDoNothing(config?: { target?: IndexColumn | IndexColumn[]; where?: SQL; }): this
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<TSelectedFields extends SelectedFieldsFlat>(fields: TSelectedFields): PgInsert<TTable, TQueryResult, SelectResultFields<TSelectedFields>>
toSQL(): Simplify<Omit<Query, "typings">>
interface PgInsert
implements QueryPromise<TReturning extends undefined ? QueryResultKind<TQueryResult, never> : TReturning[]>, SQLWrapper
import { type PgInsert } from "https://deno.land/x/drizzle@v0.23.85/pg-core.ts";

Type Parameters

TTable extends AnyPgTable
TQueryResult extends QueryResultHKT
optional
TReturning extends Record<string, unknown> | undefined = undefined