1. A method, comprising: setting, with a processor executing on a computer, one or more breakpoints in source code of a client application based on locations of Application Programming Interface (API) calls in the source code; and while running the client application through a debugger, upon reaching each of the one or more breakpoints, identifying one or more debugger rules associated with a query at a breakpoint; in response to determining that conditions of the one or more debugger rules are satisfied, obtaining a stack trace before the query makes a call to a database; and deriving query text of the query and a location of the query in source code of the client application.