Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/aether/deps.ts>Transaction#begin

A Deno library to interface with the Discord API
Latest
method Transaction.prototype.begin
import { Transaction } from "https://deno.land/x/aether@v0.0.3/deps.ts";

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 "../client.ts";

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

https://www.postgresql.org/docs/14/sql-begin.html