> I like Ernie's suggestion of a SqlStatement-like object, or even better, > settling on some duck-typing conventions for sql-like strings. > > SqlString < String could also hold its bind variables. The database adapter > could translate that to whatever native support for bound parameters, even > prepare and cache the statement.
I tried something like this as an experiment 6 months ago and it looked a promising approach. It's pretty simple to add a factory method to abstract adapter to provide a new SqlString, and get active record to use this method when building queries. Different adapters have the opportunity to provide their own SqlString class, and the responsibility for adding limits/offsets, joins, conditions, parameters, can be shared between the adapter and this special string. Tom --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
