Database access documentation

I’ve been trying to rewrite the news app mappers to use a newer version of everything to clean up the code and this has been going okay for the simple queries.
I’ve been encountering some issues with joins though. Is there any place I can look within nextcloud to find entity mapping with joins to learn from? Or is there any documentation on the system nextcloud is using under the hood?

Mail uses (the new) db mappers extensively: https://github.com/nextcloud/mail/tree/master/lib/Db

I can’t find any situations there like a mailbox entity with message entities as a property. Are those not supported or am I missing something?

Hello,

You can simple use Doctrine syntax to build your queries.
The Doctrine documentation is available here (also with join references):
https://www.doctrine-project.org/projects/doctrine-orm/en/2.7/reference/query-builder.html

1 Like

Our ORM follows more the design of a repository rather than active records. Hence there are no parent-child relations that you could work with. You’ll have to build that yourself.

1 Like