Following Uncle Bob's avice in Clean Code, I'd like to have no SQL in my PHP code. Presently I'm making use of Prepared Statements and I've factored my database access code into model classes.
My initial thought is to break out my SQL into separate SQL files and then load them at runtime. Since this involves more disk IO (my gut feeling), I'm wondering if anyone has suggestions on doing it another way.
Also, I'm interested to know if anyone's tried this and what dividends (if any it pays off).
Thank you.
If you're simply looking to separate the SQL, why not use Stored Procedures?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With