Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/kysely_postgrs_js_dialect/mod.ts>kysely.InsertQueryBuilder#$call

Kysely dialect for PostgreSQL using the Postgres.js client.
Latest
method kysely.InsertQueryBuilder.prototype.$call
Re-export
import { kysely } from "https://deno.land/x/kysely_postgrs_js_dialect@v0.27.4/mod.ts";
const { InsertQueryBuilder } = kysely;

Simply calls the provided function passing this as the only argument. $call returns what the provided function returns.

If you want to conditionally call a method on this, see the $if method.

Examples

The next example uses a helper function log to log a query:

function log<T extends Compilable>(qb: T): T {
  console.log(qb.compile())
  return qb
}

db.updateTable('person')
  .set(values)
  .$call(log)
  .execute()

Parameters

func: (qb: this) => T