-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: allow aliases in spread embeddings #3885
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
base: main
Are you sure you want to change the base?
Conversation
What's the error message?
Yeah, I haven't seen a use case for to-one spreads. |
This issue mentions it better #2529. It returns the same error here. |
#2529 it's a bit different. For spreads the name of the alias is essentially ignored, it doesn't show in the output:
So if this is a problem, I think the alias should be added automatically somehow. And we shouldn't allow aliases on spreads, since it doesn't make sense for the user. It's an implementation detail. |
Ah I just remembered, this is still useful if we want to use filters with one of the relationships. Otherwise it wouldn't be possible to know which one to filter. |
To give an example, something like this could be possible: curl 'localhost:3000/factories?select=...p1:processes(batch_count:count()),...p2:processes(total_count:count())&p1.category_id=eq.1' |
For filtering it does make sense. Maybe for another issue, I just found the following error:
|
6bae289
to
f017b67
Compare
Allows embedding the same resource multiple times without returning an error:
curl 'localhost:3000/table?select=...e1:embed(name),...e2:embed(name)'
Otherwise, without the aliases, it would return an error (the current implementation).
As mentioned here: #3640 (comment), this is going to be more commonly used in to-many spreads.