INNER CODE UNIT · TypeScript
transact
tot-ra/graphql-schema-registry · src/database/index.ts:79
export async function transact(fn) {
const trx = await connection.transaction();
try {
const result = await fn(trx);
await trx.commit();
return result;
} catch (error) {
await trx.rollback();
throw error;
}
}