mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 04:56:00 +00:00
SYNC: commit/rollback - control commands
This commit is contained in:
committed by
Diflow
parent
f81207737c
commit
11d193a6dd
@@ -56,7 +56,11 @@ module.exports = {
|
||||
handle_done(sesid, props) {
|
||||
socket.emit(`session-done-${sesid}`);
|
||||
if (!props.skipFinishedMessage) {
|
||||
this.dispatchMessage(sesid, 'Query execution finished');
|
||||
if (props.controlCommand) {
|
||||
this.dispatchMessage(sesid, `${_.startCase(props.controlCommand)} finished`);
|
||||
} else {
|
||||
this.dispatchMessage(sesid, 'Query execution finished');
|
||||
}
|
||||
}
|
||||
const session = this.opened.find(x => x.sesid == sesid);
|
||||
if (session.loadingReader_jslid) {
|
||||
@@ -144,6 +148,20 @@ module.exports = {
|
||||
return { state: 'ok' };
|
||||
},
|
||||
|
||||
executeControlCommand_meta: true,
|
||||
async executeControlCommand({ sesid, command }) {
|
||||
const session = this.opened.find(x => x.sesid == sesid);
|
||||
if (!session) {
|
||||
throw new Error('Invalid session');
|
||||
}
|
||||
|
||||
logger.info({ sesid, command }, 'Processing control command');
|
||||
this.dispatchMessage(sesid, `${_.startCase(command)} started`);
|
||||
session.subprocess.send({ msgtype: 'executeControlCommand', command });
|
||||
|
||||
return { state: 'ok' };
|
||||
},
|
||||
|
||||
executeReader_meta: true,
|
||||
async executeReader({ conid, database, sql, queryName, appFolder }) {
|
||||
const { sesid } = await this.create({ conid, database });
|
||||
|
||||
Reference in New Issue
Block a user