UNPKG

orange-orm

Version:

Object Relational Mapper

14 lines (12 loc) 458 B
let beginCommand = require('./commands/beginCommand'); let executeQuery = require('./executeQueries/executeQuery'); let setSessionSingleton = require('./setSessionSingleton'); function begin(context, transactionLess) { setSessionSingleton(context, 'changes', []); if (transactionLess) { setSessionSingleton(context, 'transactionLess', true); return Promise.resolve(); } return executeQuery(context, beginCommand(context)); } module.exports = begin;