News for hackers. Stuff that matters.
Re:What ORMs have taught me: just learn SQL (2014) by pests on Friday September 20, 2019 @08:24PM (#21032624)
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....

Re:What ORMs have taught me: just learn SQL (2014) by bpicolo on Saturday September 21, 2019 @12:16PM (#21036183)
If I remember right, it's hugely lacking in ability to interact with more complex data types in e.g. postgres, like jsonb
Re:What ORMs have taught me: just learn SQL (2014) by timdev2 on Saturday September 21, 2019 @12:34PM (#21036286)
It'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 [1] https://www.doctrine-project.org/projects/doctrine-dbal/en/2...

Re:What ORMs have taught me: just learn SQL (2014) by bpicolo on Saturday September 21, 2019 @04:02PM (#21037584)
Yeah, the missing bit was custom operator support if I remember right.