And let's not forget the most important reason to do this: this is on the path to making Rails TRULY enterprisy! :-)
We're actually getting serious kickback from using Rails at one of our clients because of this very problem. We've hacked around the issue for now but client is still not happy. We're flooding the database. Also, I would love to at least see the capability of passing bind variables directly to adapters from iBatis. I reckon we could easily make it backwards compatible, something akin to: if connection.supports_bind_variables? connection.select(['SELECT *', a, b, c]) else connection.select(quote(['SELECT *', a, b, c])) end Or, by simply wrapping non-bind-supporting adapters with a binding decorator. Or, just fix all the darned adapters, that's why we have a test suite after all: so we can be BRAVE. :-) Cheers, Jon On 5/26/06, Michael Koziarski <[EMAIL PROTECTED]> wrote:
I like the idea, however perhaps it's not ambitious enough? If instead of doing the value interpolation immediately, we could hold off and pass the full sql string down to the adapter. ["FULL SQL STRING", bunch, of, values] I've heard from thoughtworks that the performance difference for oracle is appreciable. It's probably true for other DBs too. The largest benefit though would be allowing people to insert huge blobs without a ... 65k sql statement. > A few questions though: > > 1. I'll fix any issues I find, but since this is done by post-processing > the sql there's a chance that some funky hand-coded sql could make this > fail. So I'm thinking about making this a configurable option -- > #enable_oci_binding or somesuch. Thoughts? > > 2. Do other db's support a similar concept with a similar benefit? > Should this functionality be implemented at a higher level (ie., in the > abstract adapter) to make it usable for other dbs? > > As an aside, only the pretty comprehensive AR unit tests make a patch > like this even possible to think about. So kudos to everyone on that point. > > _______________________________________________ > Rails-core mailing list > [email protected] > http://lists.rubyonrails.org/mailman/listinfo/rails-core > -- Cheers Koz _______________________________________________ Rails-core mailing list [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails-core
_______________________________________________ Rails-core mailing list [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails-core
