开发者

prepared statements in rails/activerecord

开发者 https://www.devze.com 2022-12-15 19:59 出处:网络
does rails activerecord have any support for prepared stat开发者_如何学编程ements?best I can tell -no.Since Rails 3.1 prepared statements in active_record are in place. See this presentation http://ww

does rails activerecord have any support for prepared stat开发者_如何学编程ements? best I can tell -no.


Since Rails 3.1 prepared statements in active_record are in place. See this presentation http://www.youtube.com/watch?v=kWOAHIpmLAI by Aaron Patterson.


There are recent patches available to do this for mysql:

https://rails.lighthouseapp.com/projects/8994/tickets/3151-mysql-adapter-update-to-enable-use-of-stored-procedures

For Oracle, there are 2 related projects that seem like they do the trick:

  • plsql support http://github.com/rsim/ruby-plsql

  • more goodies when using Oracle and AR, with use of ruby-plsql gem for stored procs http://wiki.github.com/rsim/oracle-enhanced/


It has some support for it, shown in this guide, but it is only syntactic support, since the ActiveRecord replaces the question marks with their values before sending to the database.

Some people (here for example) seem(ed) to be busy with prepared statement support, but no available/working results seem to be integrated into rails yet.

0

精彩评论

暂无评论...
验证码 换一张
取 消