Skip to main content
Deno 2 is finally here 🎉️
Learn more
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://deno.land/x/kysely_postgrs_js_dialect@v0.27.8/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.