postgrest-kt
postgrest-kt copied to clipboard
Documenting Queries with foreign keys requests
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!
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
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