import { postgres } from "https://deno.land/x/miranda@0.0.6/src/deps.ts";
const { Transaction } = postgres;
This method returns the snapshot id of the on going transaction, allowing you to share the snapshot state between two transactions
import { Client } from "../client.ts";
const client_1 = new Client();
const client_2 = new Client();
const transaction_1 = client_1.createTransaction("transaction");
const snapshot = await transaction_1.getSnapshot();
const transaction_2 = client_2.createTransaction("new_transaction", { isolation_level: "repeatable_read", snapshot });
// transaction_2 now shares the same starting state that transaction_1 had
https://www.postgresql.org/docs/14/functions-admin.html#FUNCTIONS-SNAPSHOT-SYNCHRONIZATION