DEV Community

Discussion on: You Can Do it in SQL, Stop Writing Extra Code for it

Collapse
 
rhymes profile image
rhymes

The balance is isolation.

You isolate the code that uses the custom SQL, you document it and test it well and like everything else, you try to have all the code that needs it use that single function that returns the DB value.

Your app can still use the ORM for 99%, but that doesn't mean we shouldn't take advantage of the DB if after measuring we conclude that the tradeoff is worth it.