mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 14:38:50 +00:00
refactor(database/rawExecute): split batched query logs
This commit is contained in:
1 parent
e57a983bc0
commit
51c84a30ca
1 file changed
+9
-3
@@ -59,9 +59,15 @@ export const rawExecute = (
|
||||
}
|
||||
|
||||
if (index === parametersLength - 1) {
|
||||
const [profiler] = <RowDataPacket[]> await connection.query('SELECT SUM(DURATION) AS `duration` FROM INFORMATION_SCHEMA.PROFILING');
|
||||
|
||||
if (profiler[0]?.duration) logQuery(invokingResource, query, parseFloat(profiler[0].duration), parameters);
|
||||
const [profiler] = <RowDataPacket[]>(
|
||||
await connection.query('SELECT SUM(DURATION) AS `duration` FROM INFORMATION_SCHEMA.PROFILING GROUP BY QUERY_ID')
|
||||
);
|
||||
|
||||
if (profiler.length > 0) {
|
||||
for (let i = 0; i < parametersLength; i++) {
|
||||
logQuery(invokingResource, query, parseFloat(profiler[i].duration), parameters[i]);
|
||||
}
|
||||
}
|
||||
|
||||
connection.release();
|
||||
|
||||
|
||||
Reference in new issue
Block a user