Skip to content
Discussion options

You must be logged in to vote

Hi @florian-lefebvre, no need for a view to query across foreign tables, you can do something like this:

const { data, error } = await supabase
    .from('organizations')
    .select('*,members:users(*)')
// console.log(JSON.stringify(data, null, 2))
//
// [
//   {
//     "id": "37fe573e-11e6-4c11-9338-be1a670f53ce",
//     "created_at": "2021-05-22T22:36:35+00:00",
//     "name": "Acme",
//     "url": "acme",
//     "description": null,
//     "members": [
//       {
//         "id": "1f599968-3105-45fb-bf50-6306a4d95a0b",
//         "name": "User 1",
//         "description": null,
//         "avatar_url": null,
//         "status": "OFFLINE"
//       },
//       {
//         "id": "54f…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@florian-lefebvre
Comment options

@soedirgo
Comment options

@florian-lefebvre
Comment options

@florian-lefebvre
Comment options

@soedirgo
Comment options

Answer selected by florian-lefebvre
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants