It would be great to be able to annotate sql with comments to tell where a query came from/or user/account runs it -> visible in slow query log and mysql status User.where(xxx).comment("user.rb:11") -> SELECT * FROM users WHERE xxx /* user.rb:11 */ User.where(xxx).comment("doing slow stuff in the console: do not kill") does this sound good -> would a patch be accepted / did anyone already build something similar ? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit groups.google.com/d/msg/rubyonrails-core/-/zZ6iZZ6hjMEJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/rubyonrails-core?hl=en.
37signals released a gem called Marginalia that does something similar: github.com/37signals/marginalia. On Friday, January 4, 2013 8:59:34 PM UTC-5, grosser wrote:> > It would be great to be able to annotate sql with comments to tell where a > query came from/or user/account runs it -> visible in slow query log and > mysql status > > User.where(xxx).comment("user.rb:11") > -> SELECT * FROM users WHERE xxx /* user.rb:11 */ > > > User.where(xxx).comment("doing slow stuff in the console: do not kill") > > > does this sound good -> would a patch be accepted / did anyone already > build something similar ?-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit groups.google.com/d/msg/rubyonrails-core/-/ynWCfU9FuVgJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/rubyonrails-core?hl=en.
On Fri, Jan 04, 2013 at 05:59:34PM -0800, grosser wrote:> > > It would be great to be able to annotate sql with comments to tell where a > query came from/or user/account runs it -> visible in slow query log and > mysql status > > User.where(xxx).comment("user.rb:11") > -> SELECT * FROM users WHERE xxx /* user.rb:11 */ > > > User.where(xxx).comment("doing slow stuff in the console: do not kill") > > > does this sound good -> would a patch be acceptedI would accept support in ARel, but I''m not sure about adding the `comment` method to AR::Relation. We''ll have to discuss it more, but the first step is to put it in ARel. -- Aaron Patterson tenderlovemaking.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/rubyonrails-core?hl=en.
Possibly Parallel Threads
- [threadsafe] Arel ToSql visitor is not threadsafe
- Issue with Arel::SelectManager and insert Method
- Float::INFINITY ranges in where() clause
- Arel - clone bug (and fix), feature requests
- question about how to set up an active record adapter to prefer use of prepared statements...