From 2fb2b2ce2a2d1f86800b238bdd8945e2146f72ad Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 8 Apr 2024 09:13:20 -0500 Subject: [PATCH] SqliteWorker: log query parameters --- src/workers/sqlite.worker.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/workers/sqlite.worker.ts b/src/workers/sqlite.worker.ts index c58e8da..1222e33 100644 --- a/src/workers/sqlite.worker.ts +++ b/src/workers/sqlite.worker.ts @@ -27,7 +27,12 @@ export const SqliteWorker = { if (perf) { const { duration } = perf.measure('end', 'start'); - console.debug(`${sql} \x1b[90m(${(duration / 1000).toFixed(2)}s)\x1b[0m`); + + console.debug( + sql.replace(/\s+/g, ' '), + JSON.stringify(parameters), + `\x1b[90m(${(duration / 1000).toFixed(2)}s)\x1b[0m`, + ); perf.clearMarks(); perf.clearMeasures();