Skip to main content
This is an overview of the basic methods available on the .

select

Executes a SELECT query, returning entitites as a result

selectOne

Executes a SELECT query, returning the first entity or null.
Does not add a LIMIT 1 to your SQL query so the whole result will be retrieved from Postgres.

insert

Runs an INSERT statement using the provided values.
Optionally returns inserted rows as .

update

Executes an UPDATE statement using the provided values and WHERE condition.
Optionally returns updated rows as

delete

Executes a DELETE statement using the provided WHERE condition.
Optionally returns deleted rows as

query

Executes the exact SQL string passed as argument. Supports params referenced by $1, $2... in SQL, values can be passed as second argument. Returns result directly from pg driver.