Skip to content

re: I need help refactoring the database module where all the creation, insertion, etc. code are in their own respective files. VIEW POST


I'd take issue with the db statements being isolated, can't insert and update in the same transaction (unless I'm missing something).

I would recommend against using a standard repository pattern in the case you migrate to an ORM since a repo pattern layer tends to have adverse effects on the ORMs performance and the additional abstraction doesn't add any benefit. But I guess that would depend on the ORM.

If a web application, I like creating a connection instance per request.

code of conduct - report abuse