mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 06:28:54 +00:00
refactor(database): query profiling
This commit is contained in:
1 parent
ef7f4156df
commit
197b92891a
4 files changed
+36
-10
No files matched your search
@@ -34,6 +34,9 @@ export const rawQuery = (
|
||||
|
||||
try {
|
||||
const [result] = await connection.query(query, parameters);
|
||||
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);
|
||||
|
||||
resolve(cb ? parseResponse(type, result) : null);
|
||||
} catch (err) {
|
||||
|
||||
Reference in new issue
Block a user