I'm trying to build my own ORM (just for fun, not that I have to) in PHP, but I'm struggling a bit in managing database connection:
If I had some models like User, Post ... which are tables in the database, would it be okay to make a connection and close it every single time that I want something from the database or find a way to start up a single connection when the app boots and then just paste that connection whenever needed?