Answer the question
In order to leave comments, you need to log in
What is the justification for using QueryBuilder and ActiveRecord in the same project?
What is the justification for using QueryBuilder and ActiveRecord in the same project?
I'm very interested in how to justify the use of these two approaches to working with the database in one project ... And is it reasonable to use one QueriBuilder in this case and abandon ActiveRecords, in particular when using queries with JOIN, UNION
Answer the question
In order to leave comments, you need to log in
AR generally uses its own QueryBuilder.
And in total it is called ORM
. Also, QueryBuilder can be called "directly". he is public.
So they are not interchangeable things at all.
Another question is if two different unrelated libraries are used, this is already something terrible. I have not seen this.
Well, something tells me not to.
BEFORE ASKING THIS, YOU SHOULD understand what QueryBuilder is and what ActiveRecord
is QueryBuilder is a SQL query constructor
ActiveRecord is an ORM
these two technologies are in fact, theoretically NOT related to each other, but ORM most likely uses QB
And is it reasonable to use one QueriBuilder in this case and abandon ActiveRecords, in particular when using queries with JOIN, UNIONYes. This is normal practice. No need to use ORM to try to make big requests. ORM is for trivial things.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question