Module

x/kysely_postgrs_js_dialect/deps.ts>kysely.InsertQueryBuilder#executeTakeFirstOrThrow

Kysely dialect for PostgreSQL using the Postgres.js client.
method kysely.InsertQueryBuilder.prototype.executeTakeFirstOrThrow
import { kysely } from "https://dotland.deno.dev/x/kysely_postgrs_js_dialect@v0.27.3/deps.ts";
const { InsertQueryBuilder } = kysely;

Executes the query and returns the first result or throws if the query returned no result.

By default an instance of NoResultError is thrown, but you can provide a custom error class, or callback as the only argument to throw a different error.

Parameters

optional
errorConstructor: NoResultErrorConstructor | ((node: QueryNode) => Error)

Returns

Promise<SimplifyResult<O>>