Skip to content

Commit

Permalink
Store the file location where a SQL command is called from
Browse files Browse the repository at this point in the history
  • Loading branch information
yazz committed Nov 19, 2024
1 parent 46f8b4f commit 3882698
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions public/go.html
Original file line number Diff line number Diff line change
Expand Up @@ -13409,11 +13409,28 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
if ((dbgCode != null) && (yz.uiDb.tablesCreated)) {
if (startOfSql.startsWith("insert") || startOfSql.startsWith("update") || startOfSql.startsWith("delete")) {
debugger
let sourceForCallerOfFunction = yz.uiDb.findSourceLineInCode(dbgCode)
let sourceFileName = null
let lineNumber = null
if (sourceForCallerOfFunction.found) {
sourceFileName = sourceForCallerOfFunction.fileName
lineNumber = sourceForCallerOfFunction.lineNumber
}
let steps = yz.uiDb.currentDebugStack.steps
let lastTraceid = yz.uiDb.currentDebugStack.steps[yz.uiDb.currentDebugStack.steps.length - 1]

yz.uiDb.sqlui("INSERT INTO ui_table_debug_sql_log ( debug_tracer_id, sql_statement , fk_parent_debug_trace_log_id, debug_tick ) VALUES (?,?,?,?)",
[dbgCode, sql, lastTraceid, yz.uiDb.currentDebugStack.debugTick])
let lastTraceid = null
if (steps && (steps.length > 0)) {
lastTraceid = steps[steps.length - 1]
}

yz.uiDb.sqlui("INSERT INTO ui_table_debug_sql_log ( debug_tracer_id , sql_statement , fk_parent_debug_trace_log_id , debug_tick , file_name , line_number ) VALUES (?,?,?,?,?,?)",
[
dbgCode,
sql,
lastTraceid,
yz.uiDb.currentDebugStack.debugTick,
sourceFileName,
lineNumber
])
//zzz
}
}
Expand Down Expand Up @@ -14084,10 +14101,6 @@ <h1 style='width:100%;vertical-align:top;display:inline-block;font-size:100px; t
}
}
let callerLine = callStack[callStackIndex]
yz.uiDb.currentDebugStack.currentDebugId
yz.uiDb.currentDebugStack.start
yz.uiDb.currentDebugStack.debugTracerId
debugger
}
}
//
Expand Down

0 comments on commit 3882698

Please sign in to comment.