3 ms·
I'd rearrange the list a bit to what I see experienced devs do, and I don't see a problem with it: 1. Lets use an ORM because it'll be easier (skipping 2, bec
by viraptor 6y ago
I'd rearrange the list a bit to what I see experienced devs do, and I don't see a problem with it:
1. Lets use an ORM because it'll be easier
(skipping 2, because it's not really a mess; skipping 3, because they know that before getting to this point)
4. Run that through EXPLAIN ANALYZE
5. Can't make the ORM do that
6. Use native query
7. Profit
There's nothing wrong with having `Users.active.find(id)` where you want it and writing out the complex query as SQL where it gets complicated. They can live next to each other just fine and still improve your life.
Going extreme in any direction is going to cause problems. (whether 100% ORM, or SQL purity) It's fine to use different approaches where they're appropriate.