Skip to content

How to Select / Join From Subquery? #1355

Answered by simolus3
aldycool asked this question in Q&A
Discussion options

You must be logged in to vote

Of course, those queries are fully supported in moor files where SQL is analyzed at compile-time to generate result classes.

Unfortunately, we can't generally support those features in Dart. To be safe, we'd have to generate a new result class for each subquery since it can introduce a new result set not covered by an existing class. That's not the case in the examples you posted and we could support subqueries where we select all columns from an existing table. It's just that those subqueries aren't particularly useful in practice, since you can also write them as regular joins.

Or, if those are not supported right now, is there any open classes that I can (safely) subclass or override?…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@aldycool
Comment options

Answer selected by aldycool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants