mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 22:36:01 +00:00
rowsAffected field added
This commit is contained in:
@@ -165,6 +165,7 @@ async function tediousReadQuery(dbhan, sql, structure) {
|
|||||||
|
|
||||||
async function tediousStream(dbhan, sql, options) {
|
async function tediousStream(dbhan, sql, options) {
|
||||||
let currentColumns = [];
|
let currentColumns = [];
|
||||||
|
let skipAffectedMessage = false;
|
||||||
|
|
||||||
const handleInfo = info => {
|
const handleInfo = info => {
|
||||||
const { message, lineNumber, procName } = info;
|
const { message, lineNumber, procName } = info;
|
||||||
@@ -200,11 +201,14 @@ async function tediousStream(dbhan, sql, options) {
|
|||||||
dbhan.client.off('infoMessage', handleInfo);
|
dbhan.client.off('infoMessage', handleInfo);
|
||||||
dbhan.client.off('errorMessage', handleError);
|
dbhan.client.off('errorMessage', handleError);
|
||||||
|
|
||||||
options.info({
|
if (!skipAffectedMessage) {
|
||||||
message: `${rowCount} rows affected`,
|
options.info({
|
||||||
time: new Date(),
|
message: `${rowCount} rows affected`,
|
||||||
severity: 'info',
|
time: new Date(),
|
||||||
});
|
severity: 'info',
|
||||||
|
rowsAffected: rowCount,
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
request.on('columnMetadata', function (columns) {
|
request.on('columnMetadata', function (columns) {
|
||||||
currentColumns = extractTediousColumns(columns);
|
currentColumns = extractTediousColumns(columns);
|
||||||
@@ -216,6 +220,7 @@ async function tediousStream(dbhan, sql, options) {
|
|||||||
columns.map(x => x.value)
|
columns.map(x => x.value)
|
||||||
);
|
);
|
||||||
options.row(row);
|
options.row(row);
|
||||||
|
skipAffectedMessage = true;
|
||||||
});
|
});
|
||||||
dbhan.client.execSqlBatch(request);
|
dbhan.client.execSqlBatch(request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ const drivers = driverBases.map(driverBase => ({
|
|||||||
message: `${row.affectedRows} rows affected`,
|
message: `${row.affectedRows} rows affected`,
|
||||||
time: new Date(),
|
time: new Date(),
|
||||||
severity: 'info',
|
severity: 'info',
|
||||||
|
rowsAffected: row.affectedRows,
|
||||||
});
|
});
|
||||||
if (row.stateChanges?.schema) {
|
if (row.stateChanges?.schema) {
|
||||||
options.changedCurrentDatabase(row.stateChanges.schema);
|
options.changedCurrentDatabase(row.stateChanges.schema);
|
||||||
|
|||||||
@@ -223,6 +223,7 @@ const driver = {
|
|||||||
message: `${rowsAffected} rows affected`,
|
message: `${rowsAffected} rows affected`,
|
||||||
time: new Date(),
|
time: new Date(),
|
||||||
severity: 'info',
|
severity: 'info',
|
||||||
|
rowsAffected,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -232,6 +232,7 @@ const drivers = driverBases.map(driverBase => ({
|
|||||||
message: `${rowCount} rows affected`,
|
message: `${rowCount} rows affected`,
|
||||||
time: new Date(),
|
time: new Date(),
|
||||||
severity: 'info',
|
severity: 'info',
|
||||||
|
rowsAffected: rowCount,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ const libsqlDriver = {
|
|||||||
message: `${rowCounter.count} rows affected`,
|
message: `${rowCounter.count} rows affected`,
|
||||||
time: new Date(),
|
time: new Date(),
|
||||||
severity: 'info',
|
severity: 'info',
|
||||||
|
rowsAffected: rowCounter.count,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ const driver = {
|
|||||||
message: `${rowCounter.count} rows affected`,
|
message: `${rowCounter.count} rows affected`,
|
||||||
time: new Date(),
|
time: new Date(),
|
||||||
severity: 'info',
|
severity: 'info',
|
||||||
|
rowsAffected: rowCounter.count,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ function runStreamItem(dbhan, sql, options, rowCounter) {
|
|||||||
message: `${rowCounter.count} rows affected`,
|
message: `${rowCounter.count} rows affected`,
|
||||||
time: new Date(),
|
time: new Date(),
|
||||||
severity: 'info',
|
severity: 'info',
|
||||||
|
rowsAffected: rowCounter.count,
|
||||||
});
|
});
|
||||||
rowCounter.count = 0;
|
rowCounter.count = 0;
|
||||||
rowCounter.date = null;
|
rowCounter.date = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user