V
V
Vadim2015-01-07 01:17:02
PHP
Vadim, 2015-01-07 01:17:02

What SQL builders for PHP do you use?

Interested in PHP libraries / classes that allow you to dynamically build SQL statements. But so that without a hard binding to MySQL, there is the ability to chain drivers for different databases. Who uses what and why?
Components tied to specific CMS / frameworks, only inside which they can be used, are not of interest.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
T
Twist, 2015-01-07
@bboytiwst

In PHP, all ORMs are divided into 2 classes. They differ in the main design pattern taken as a basis, namely
1 - Sport ORM, Doctrine ORM are based on Doctrine DBAL which can also be used separately, without the ORM itself. Doctrine ORM gives a little more room to expand and is a more complex and correspondingly heavy solution, which does not make much sense for small sites. ORMs of this type are great for medium and almost large sites :D
2 - Anything with ActiveRecord on board is often a bit simpler both architecturally and in use. These types of ORMs are great for small to medium sites. When working with them, any manipulation with the entity is work with a record in the table.
ActiveRecord ORM is great for small sites.
For large portals / sites / services, in my opinion, only Plain SQL is suitable without most of the bells and whistles provided by ORMs, because they take a lot of resources, extra requests appear, a lot is spent on hydration into objects, etc.

R
raycheel, 2015-01-07
@raycheel

Propel or Propel2 is a super cool ORM with query generation. I love it, I use it almost everywhere.
Look here.

S
Sergey Nalomenko, 2015-01-07
@nalomenko

PDO

S
Sergey, 2015-01-07
Protko @Fesor

Doctrine ORM has a powerful built-in object bound query builder. Generating a schema and migrations based on metadata, in short ... I haven’t seen anything more convenient and I don’t think there is anything more convenient at the moment (propel is in second place, perhaps).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question