Answer the question
In order to leave comments, you need to log in
What are the most convenient ways to wrap MySQL method calls?
Good afternoon!
I constantly have to work with sql databases in my programs, and I constantly carry my "sugar" for easy access to the database.
For example:
The main goal: the ability to "collect" one query by calls in different places (for example, when some part of Where is not needed depending on the input parameters, the ability to immediately accept a list of values, etc.) + checking for a shot in the foot ( for example with update ... where id>0)
I saw a different approach in PHP frameworks, but mainly due to the dynamic nature of PHP I don’t see the opportunity to implement this in C ++ (but I only looked at a couple of frameworks (one of them is Doctrine), maybe you please advise in which one is most conveniently implemented).db->select("*", "table").Where("a", "b").Exec();
Maybe you know some principles/approaches/templates for implementing such wrappers, or maybe you wrote them yourself and there is a link to github?
PS Now I'm reading about ActiveRecord, but in my opinion a class instance for each record is very expensive in terms of resources, isn't it?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question