Optional
fetch?: ((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>)Optional
init: RequestInitOptional
headers?: HeadersInitOptional
schema?: stringOptional
fetchOptional
init: RequestInitOptional
schemaOptional
signalNamed parameters
Optional
count?: "exact" | "planned" | "estimated"Count algorithm to use to count deleted rows.
"exact"
: Exact but slow count algorithm. Performs a COUNT(*)
under the
hood.
"planned"
: Approximated but fast count algorithm. Uses the Postgres
statistics under the hood.
"estimated"
: Uses exact count for low numbers and planned count for high
numbers.
Perform an INSERT into the table or view.
By default, inserted rows are not returned. To return it, chain the call
with .select()
.
The values to insert. Pass an object to insert a single row or an array to insert multiple rows.
Optional
options: { Named parameters
Optional
count?: "exact" | "planned" | "estimated"Count algorithm to use to count inserted rows.
"exact"
: Exact but slow count algorithm. Performs a COUNT(*)
under the
hood.
"planned"
: Approximated but fast count algorithm. Uses the Postgres
statistics under the hood.
"estimated"
: Uses exact count for low numbers and planned count for high
numbers.
Perform an INSERT into the table or view.
By default, inserted rows are not returned. To return it, chain the call
with .select()
.
The values to insert. Pass an object to insert a single row or an array to insert multiple rows.
Optional
options: { Named parameters
Optional
count?: "exact" | "planned" | "estimated"Count algorithm to use to count inserted rows.
"exact"
: Exact but slow count algorithm. Performs a COUNT(*)
under the
hood.
"planned"
: Approximated but fast count algorithm. Uses the Postgres
statistics under the hood.
"estimated"
: Uses exact count for low numbers and planned count for high
numbers.
Optional
defaultMake missing fields default to null
.
Otherwise, use the default value for the column. Only applies for bulk
inserts.
Perform a SELECT query on the table or view.
Optional
columns: QueryThe columns to retrieve, separated by commas. Columns can be renamed when returned with customName:columnName
Named parameters
Optional
count?: "exact" | "planned" | "estimated"Count algorithm to use to count rows in the table or view.
"exact"
: Exact but slow count algorithm. Performs a COUNT(*)
under the
hood.
"planned"
: Approximated but fast count algorithm. Uses the Postgres
statistics under the hood.
"estimated"
: Uses exact count for low numbers and planned count for high
numbers.
Optional
head?: booleanWhen set to true
, data
will not be returned.
Useful if you only need the count.
Perform an UPDATE on the table or view.
By default, updated rows are not returned. To return it, chain the call
with .select()
after filters.
The values to update with
Named parameters
Optional
count?: "exact" | "planned" | "estimated"Count algorithm to use to count updated rows.
"exact"
: Exact but slow count algorithm. Performs a COUNT(*)
under the
hood.
"planned"
: Approximated but fast count algorithm. Uses the Postgres
statistics under the hood.
"estimated"
: Uses exact count for low numbers and planned count for high
numbers.
Perform an UPSERT on the table or view. Depending on the column(s) passed
to onConflict
, .upsert()
allows you to perform the equivalent of
.insert()
if a row with the corresponding onConflict
columns doesn't
exist, or if it does exist, perform an alternative action depending on
ignoreDuplicates
.
By default, upserted rows are not returned. To return it, chain the call
with .select()
.
The values to upsert with. Pass an object to upsert a single row or an array to upsert multiple rows.
Optional
options: { Named parameters
Optional
count?: "exact" | "planned" | "estimated"Count algorithm to use to count upserted rows.
"exact"
: Exact but slow count algorithm. Performs a COUNT(*)
under the
hood.
"planned"
: Approximated but fast count algorithm. Uses the Postgres
statistics under the hood.
"estimated"
: Uses exact count for low numbers and planned count for high
numbers.
Optional
ignoreIf true
, duplicate rows are ignored. If
false
, duplicate rows are merged with existing rows.
Optional
onComma-separated UNIQUE column(s) to specify how
duplicate rows are determined. Two rows are duplicates if all the
onConflict
columns are equal.
Perform an UPSERT on the table or view. Depending on the column(s) passed
to onConflict
, .upsert()
allows you to perform the equivalent of
.insert()
if a row with the corresponding onConflict
columns doesn't
exist, or if it does exist, perform an alternative action depending on
ignoreDuplicates
.
By default, upserted rows are not returned. To return it, chain the call
with .select()
.
The values to upsert with. Pass an object to upsert a single row or an array to upsert multiple rows.
Optional
options: { Named parameters
Optional
count?: "exact" | "planned" | "estimated"Count algorithm to use to count upserted rows.
"exact"
: Exact but slow count algorithm. Performs a COUNT(*)
under the
hood.
"planned"
: Approximated but fast count algorithm. Uses the Postgres
statistics under the hood.
"estimated"
: Uses exact count for low numbers and planned count for high
numbers.
Optional
defaultMake missing fields default to null
.
Otherwise, use the default value for the column. This only applies when
inserting new rows, not when merging with existing rows under
ignoreDuplicates: false
. This also only applies when doing bulk upserts.
Optional
ignoreIf true
, duplicate rows are ignored. If
false
, duplicate rows are merged with existing rows.
Optional
onComma-separated UNIQUE column(s) to specify how
duplicate rows are determined. Two rows are duplicates if all the
onConflict
columns are equal.
Generated using TypeDoc
Perform a DELETE on the table or view.
By default, deleted rows are not returned. To return it, chain the call with
.select()
after filters.