Module

x/kysely_postgrs_js_dialect/mod.ts>wrapTransaction

Kysely dialect for PostgreSQL using the Postgres.js client.
Latest
function wrapTransaction
import { wrapTransaction } from "https://dotland.deno.dev/x/kysely_postgrs_js_dialect@0.27.7/mod.ts";

Wraps a callback in a transaction.

Examples

Example 1

const users = await wrapTransaction(async (trx) => {
  return await trx.selectFrom("user").selectAll().execute();
});

Parameters

callback: Callback<T, U>
  • The callback to wrap.

Returns

Promise<U>

The result of the callback.