I've searched this but couldn't find anything in requests, and this isn't available in CI 3.10.0, so here goes.
Would it make sense to add backtrace to SQL errors that are saved in log file?
For any bigger site / application, without any context it's hard to match breaking SQL query with actual code snippet.
Another solution, add optional SQL comment in the end of every query ( SELECT * FROM table -- PHP file [_LINE_] ) - that way it'll be part of the query and automatically gets saved, and it would be beneficial if let's say slow queries are saved by DB server, easy to see link between SQL statement and script that called it.