3 ms·
The PHP ORM Doctrine supports a custom SQL like language called DQL that integrates your defined model/relationships as well as converting it to the correct SQ
by pests 7y ago
The PHP ORM Doctrine supports a custom SQL like language called DQL that integrates your defined model/relationships as well as converting it to the correct SQL dialect for your backing store.
Queries look like:
SELECT u FROM ForumUser u WHERE (u.username = :name OR u.username = :name2) AND u.id = :id
Where ForumUser is your model.
https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/dql-doctrine-query-language.html https://www.doctrine-project.org/projects/doctrine-orm/en/2....
- bpicolo 7y agoIf I remember right, it's hugely lacking in ability to interact with more complex data types in e.g. postgres, like jsonb
- timdev2 7y agoIt's certainly limiting, though you can write (or find implementations[0] of) custom types[1] that can be pretty powerful (void where prohibited, limitations apply). [0] https://github.com/martin-georgiev/postgresql-for-doctrine https://github.com/martin-georgiev/postgresql-for-doctrine [1] https://www.doctrine-project.org/projects/doctrine-dbal/en/2.9/reference/types.html#custom-mapping-types https://www.doctrine-project.org/projects/doctrine-dbal/en/2...
- bpicolo 7y agoYeah, the missing bit was custom operator support if I remember right.