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


PostgreSQL driver for Deno
Extremely Popular
method Transaction.prototype.begin
import { Transaction } from "";

The begin method will officially begin the transaction, and it must be called before any query or transaction operation is executed in order to lock the session

import { Client } from "";
const client = new Client();
const transaction = client.createTransaction("transaction_name");

await transaction.begin(); // Session is locked, transaction operations are now safe
// Important operations
await transaction.commit(); // Session is unlocked, external operations can now take place