Initial commit
This commit is contained in:
32
node_modules/knex/lib/dialects/redshift/transaction.js
generated
vendored
Executable file
32
node_modules/knex/lib/dialects/redshift/transaction.js
generated
vendored
Executable file
@@ -0,0 +1,32 @@
|
||||
const Transaction = require('../../execution/transaction');
|
||||
|
||||
module.exports = class Redshift_Transaction 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 ${trxMode};`);
|
||||
}
|
||||
|
||||
savepoint(conn) {
|
||||
this.trxClient.logger('Redshift does not support savepoints.');
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
release(conn, value) {
|
||||
this.trxClient.logger('Redshift does not support savepoints.');
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
rollbackTo(conn, error) {
|
||||
this.trxClient.logger('Redshift does not support savepoints.');
|
||||
return Promise.resolve();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user