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
Failing to decode models when querying foreign tables #322
Comments
Digging a little deeper into this, it seems like the value being decoded, is not the value being returned from the server. Looking at the response from the url request, I can see that it is not the value that |
Hi @bstillitano thanks for opening the issue, I'll investigate it. The foreign key to account schema is named While that, I'll investigate to check if there is any other issue. Thanks again. |
Thanks for getting back to me @grdsdev , I'm not quite sure how to do that. Are you able to point me in the right direction on how to do that? I can't see it in the GUI anywhere. |
Sure, see the |
@grdsdev have done that and get the following error:
For what it's worth:
It's worth noting also, that if I pass |
When you pass To fix that, you need to use field aliasing, use |
@bstillitano I hope that helped you, I'll be closing this issue for know, if you're still having issues with it, feel free to re-open it. Thanks. |
Apologies, this issue is unresolved. That didn't help, I've just had to provide the entire query as a string for now to work around this |
@bstillitano can you provide me the full schema for the |
@grdsdev sure, see attached |
@bstillitano I was able to make it work by applying the following changes:
alter table transactions rename column account to account_id;
I'll chat with the team to add some best practices to the docs regarding the implementation of relationships. Thanks. |
Bug report
Describe the bug
When providing a
.select
modifier that points to a foreign table, values fail to decode.To Reproduce
Models
SDK Usage
Swift Error
Expected behavior
The docs make it clear that I should be able to do this and get back the full object from the foreign table. https://supabase.com/docs/reference/swift/select?example=querying-foreign-table-with-count
Additional context
If I add every value to my query individually, the request works as expected:
The text was updated successfully, but these errors were encountered: