Hi Neil Munro,
I'm glad to announce that this feature is available on version 10.0.912 and forward.
To enable this capability you need to install the new version of Factory Configuration forge component and check the option "Allow Comment With Query Path". After enable this feature you will have to publish any module that you would like to trace back where in the code the query is located.
This will add a comment on the executed SQL with a breadcrumb of the query location (module -> Service/Server/Screen action).
Thanks for the feedback and hope this fulfill your use case.