how do I make a direct SQL call (e.g. LOCK TABLES)?

Hi,

I’m stuck. I can’t quite see in Rails how to make a direct database call (e.g. LOCK TABLES…), and leverage the rails connection framework?

How do you do this? I see the “execute” command in ActiveRecord::ConnectionAdapters::DatabaseStatements doesn’t seem to work.

Thanks

You can call:

  Mymodel.connection.execute("LOCK TABLES...")

with whatever SQL you need...

Brent

Greg Hauptmann wrote: