Initial commit
This commit is contained in:
19
node_modules/knex/lib/dialects/postgres/execution/pg-transaction.js
generated
vendored
Executable file
19
node_modules/knex/lib/dialects/postgres/execution/pg-transaction.js
generated
vendored
Executable file
@@ -0,0 +1,19 @@
|
||||
const Transaction = require('../../../execution/transaction');
|
||||
|
||||
class Transaction_PG extends Transaction {
|
||||
begin(conn) {
|
||||
const trxMode = [
|
||||
this.isolationLevel ? `ISOLATION LEVEL ${this.isolationLevel}` : '',
|
||||
this.readOnly ? 'READ ONLY' : '',
|
||||
]
|
||||
.join(' ')
|
||||
.trim();
|
||||
|
||||
if (trxMode.length === 0) {
|
||||
return this.query(conn, 'BEGIN;');
|
||||
}
|
||||
return this.query(conn, `BEGIN TRANSACTION ${trxMode};`);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Transaction_PG;
|
||||
Reference in New Issue
Block a user