2020-12-28 16:55:08 +02:00
|
|
|
const Transaction = require('../../execution/transaction');
|
2018-02-03 08:33:02 -05:00
|
|
|
|
2019-06-04 00:37:17 +02:00
|
|
|
module.exports = class Redshift_Transaction extends Transaction {
|
2020-12-30 16:13:35 +00:00
|
|
|
begin(conn) {
|
|
|
|
if (this.isolationLevel) {
|
|
|
|
return this.query(conn, `BEGIN ISOLATION LEVEL ${this.isolationLevel};`);
|
|
|
|
}
|
|
|
|
return this.query(conn, 'BEGIN;');
|
|
|
|
}
|
|
|
|
|
2018-02-03 08:33:02 -05:00
|
|
|
savepoint(conn) {
|
2018-05-29 17:42:03 +02:00
|
|
|
this.trxClient.logger('Redshift does not support savepoints.');
|
2018-07-09 08:10:34 -04:00
|
|
|
return Promise.resolve();
|
2018-02-03 08:33:02 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
release(conn, value) {
|
2018-05-29 17:42:03 +02:00
|
|
|
this.trxClient.logger('Redshift does not support savepoints.');
|
2018-07-09 08:10:34 -04:00
|
|
|
return Promise.resolve();
|
2018-02-03 08:33:02 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
rollbackTo(conn, error) {
|
2018-05-29 17:42:03 +02:00
|
|
|
this.trxClient.logger('Redshift does not support savepoints.');
|
2018-07-09 08:10:34 -04:00
|
|
|
return Promise.resolve();
|
2018-02-03 08:33:02 -05:00
|
|
|
}
|
2019-06-04 00:37:17 +02:00
|
|
|
};
|