Hi all, I was wondering about what is the general consensus regarding using SQL stored procedures in RoR. Based on the fact that stored procedures are not mentioned in most (any) of the RoR manuals I read, I can conclude their usage is discouraged. Is there any particular reason against using SPs? Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Stored procedures put logic into the database. A place where it''s hard to test, hard to version control, hard to access, and typically written in a low-level language that''s a pain to deal with. Every now and then, you might find yourself in a situation where they''re actually worth it for performance reasons. Just like some times it makes sense to write a piece of your application in C. Treat stored procedures like C: Avoid it like the plague until it''s your only hope for survival. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I think, in general, people using Rails prefer to have all their code within their Rails app rather than use stored procedures. I use stored procs all the time with Rails, because I prefer to have the database "protect itself" from bad data, rather than rely on the application/s to do it for me. That''s the big issue for me, although I also use stored procs with Rails for other purposes. It seems to be as much individual preference, and different experiences, as anything else - I don''t believe either approach is "better" than the other. Regards Dave M. On 07/05/07, wintermute <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi all, > > I was wondering about what is the general consensus regarding using SQL > stored procedures in RoR. Based on the fact that stored procedures are > not mentioned in most (any) of the RoR manuals I read, I can conclude > their usage is discouraged. > > Is there any particular reason against using SPs? > > Thanks > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---