Is the question about how to version the query? You have comments before the query that allow you to name the exported function so you could have both queries and name them something different.
Hibernate Query Language. How is it out of context?
Use Named Native Query and you have SQL queries.
I really don’t understand the objection to ORMs. By that logic, you might as well reserve a block of memory and offsets instead of class/struct attributes.
For example I have original query:
Then some refactoring later it becomes: As I understand go API would not change it still query(int, int).