basecamp/marginalia

Prefix query with comment instead of suffix?

clayallsopp opened this issue · 2 comments

Hey there, this is pretty awesome - would you be open to flipping the order of the underlying SQL query and the Marginalia comment?

i.e. SELECT * FROM foo /*line:foo.rb*/ becomes /*line:foo.rb*/ SELECT * FROM foo? We have some queries that are pretty long and it's a little easier to see the metadata upfront

Can either switch it to the default or make it some kind of configuration option

I don't think I would like to change to default to that.
In the places I used Marginalia, the query is always more important than the comment, so it needs to come first.

I am seeing issues with log aggregation where large queries get their marginalia truncated. A partial query with marginalia is going to be locatable based on some other logging. A partial query with no marginalia is just a rabbits hole.

It would certainly be interesting to have the marginalia in these cases. Maybe an option to invert the order would be ok?