j4mie / idiorm

A lightweight nearly-zero-configuration object-relational mapper and fluent query builder for PHP5.
http://j4mie.github.com/idiormandparis/
2.01k stars 369 forks source link

Provide method to actually run a raw query #277

Closed aaronpk closed 9 years ago

aaronpk commented 9 years ago

Right now it looks like raw_query is expected to be used with find_one() or find_many() which means it can't be used for a query like an update or other non-select query. It would be great if I could do something like ORM::execute('UPDATE users SET active = 0') and it would just run that query and not expect any results to be returned.

treffynnon commented 9 years ago

Would raw_execute() suit your needs?

aaronpk commented 9 years ago

oh yes, I think it would work. I didn't see it mentioned in the "raw query" section of the docs: https://idiorm.readthedocs.org/en/latest/querying.html

treffynnon commented 9 years ago

Please feel free to submit a pull request improving the docs.