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) {
|
||||
let currentColumns = [];
|
||||
let skipAffectedMessage = false;
|
||||
|
||||
const handleInfo = info => {
|
||||
const { message, lineNumber, procName } = info;
|
||||
@@ -200,11 +201,14 @@ async function tediousStream(dbhan, sql, options) {
|
||||
dbhan.client.off('infoMessage', handleInfo);
|
||||
dbhan.client.off('errorMessage', handleError);
|
||||
|
||||
options.info({
|
||||
message: `${rowCount} rows affected`,
|
||||
time: new Date(),
|
||||
severity: 'info',
|
||||
});
|
||||
if (!skipAffectedMessage) {
|
||||
options.info({
|
||||
message: `${rowCount} rows affected`,
|
||||
time: new Date(),
|
||||
severity: 'info',
|
||||
rowsAffected: rowCount,
|
||||
});
|
||||
}
|
||||
});
|
||||
request.on('columnMetadata', function (columns) {
|
||||
currentColumns = extractTediousColumns(columns);
|
||||
@@ -216,6 +220,7 @@ async function tediousStream(dbhan, sql, options) {
|
||||
columns.map(x => x.value)
|
||||
);
|
||||
options.row(row);
|
||||
skipAffectedMessage = true;
|
||||
});
|
||||
dbhan.client.execSqlBatch(request);
|
||||
}
|
||||
|
||||
@@ -129,6 +129,7 @@ const drivers = driverBases.map(driverBase => ({
|
||||
message: `${row.affectedRows} rows affected`,
|
||||
time: new Date(),
|
||||
severity: 'info',
|
||||
rowsAffected: row.affectedRows,
|
||||
});
|
||||
if (row.stateChanges?.schema) {
|
||||
options.changedCurrentDatabase(row.stateChanges.schema);
|
||||
|
||||
@@ -223,6 +223,7 @@ const driver = {
|
||||
message: `${rowsAffected} rows affected`,
|
||||
time: new Date(),
|
||||
severity: 'info',
|
||||
rowsAffected,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,6 +232,7 @@ const drivers = driverBases.map(driverBase => ({
|
||||
message: `${rowCount} rows affected`,
|
||||
time: new Date(),
|
||||
severity: 'info',
|
||||
rowsAffected: rowCount,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@ const libsqlDriver = {
|
||||
message: `${rowCounter.count} rows affected`,
|
||||
time: new Date(),
|
||||
severity: 'info',
|
||||
rowsAffected: rowCounter.count,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -69,6 +69,7 @@ const driver = {
|
||||
message: `${rowCounter.count} rows affected`,
|
||||
time: new Date(),
|
||||
severity: 'info',
|
||||
rowsAffected: rowCounter.count,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -27,6 +27,7 @@ function runStreamItem(dbhan, sql, options, rowCounter) {
|
||||
message: `${rowCounter.count} rows affected`,
|
||||
time: new Date(),
|
||||
severity: 'info',
|
||||
rowsAffected: rowCounter.count,
|
||||
});
|
||||
rowCounter.count = 0;
|
||||
rowCounter.date = null;
|
||||
|
||||
Reference in New Issue
Block a user