Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Documenting Queries with foreign keys requests #2

Open
lmick002 opened this issue Apr 17, 2021 · 2 comments
Open

Documenting Queries with foreign keys requests #2

lmick002 opened this issue Apr 17, 2021 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@lmick002
Copy link

Improve documentation

https://github.com/supabase/postgrest-kt

Documentation showing how to use foreign keys within postgres-kt select statements would be beneficial, especially for those not experienced with the library.

Reference code showing the foreign key usage would be greatly appreciated.
Thanks!

@lmick002 lmick002 added the documentation Improvements or additions to documentation label Apr 17, 2021
@lmick002
Copy link
Author

lmick002 commented Apr 17, 2021

For more context here's our query that we're trying to adapt to the postrgres-kt library from the javascript library.

`

const { data: profile, error } = await db.from("profiles")
.select(
*, tools: tools_user_id_fkey(*), shops: shops_user_id_fkey(*) )
.eq('id', id)
.is('deleted_at', null)
.single();`

But it's not returning the tools & shops related to the profile

@kevcodez
Copy link
Collaborator

I need to have a look at how the JS client does this, definitely haven't tested it. If you figure this out, feel free to contribute a PR as time is pretty tight on my side ATM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants