Source code line numbers for database queries in Ruby on Rails with Marginalia and Query Logs
Back in 2022, we covered how to log database query information using the pg_stat_statements extension for Postgres. https://andyatkinson.com/blog/2022/10/07/pgsqlphriday-2-truths-lie