Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relationship with entities and queries #483

Open
afiocre opened this issue Jan 13, 2021 · 4 comments
Open

Relationship with entities and queries #483

afiocre opened this issue Jan 13, 2021 · 4 comments
Labels
enhancement Non code related change

Comments

@afiocre
Copy link

afiocre commented Jan 13, 2021

Hi,

is it possible to do into the DAO a join with 2 entities who are link with foreign key ?
In order to have the parent and a list of children into the parent object ?

And if we have always the parent and a list of children in memories, can we use the @insert in order to insert into Moor on the 2 tables (like cascade in Doctrine) ?

If yes, do you have example of this 2 questions ?

Thanks

@vitusortner
Copy link
Collaborator

is it possible to do into the DAO a join with 2 entities who are link with foreign key ?
In order to have the parent and a list of children into the parent object ?

Joined return values (e.g. parent with children in one row) are currently only partly supported. Can a database view help you in this situation? Database views fully support JOIN clauses.

And if we have always the parent and a list of children in memories, can we use the @insert in order to insert into Moor on the 2 tables (like cascade in Doctrine) ?

If both floor and moor databases access the same database file, there should technically not be a problem with that. I have never tried that myself though.

@idkq
Copy link

idkq commented Feb 14, 2021

This feature would be amazing, I’m actually currently working on it. Similar to what django offers.

@idkq
Copy link

idkq commented Feb 15, 2021

Take a look #492

@mqus
Copy link
Collaborator

mqus commented Apr 23, 2021

Joins as a feature can be achieved through multiple means:

But as this question isn't asked for the first time, I think we should improve the documentation on views, to include at least an example for joins.

@mqus mqus added the enhancement Non code related change label Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Non code related change
Development

No branches or pull requests

4 participants