UNPKG

sipp

Version:

An Opinionated, High-Productivity MVC Web Framework in TypeScript

15 lines 581 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.transacting = void 0; const db_1 = require("../../db"); const async_store_1 = require("../../utils/async-store"); const transacting = async (req) => { req.logger.debug('initializing transaction'); const store = async_store_1.getStore(); if (!store.has("__TRANSACTION_KEY__")) { const trx = await db_1.Model.startTransaction(); async_store_1.getStore().set("__TRANSACTION_KEY__", trx); } }; exports.transacting = transacting; //# sourceMappingURL=transacting.js.map