mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
[docs] fix code and response querying foreign table with inner join (#20975)
fix: code and response querying foreign table with inner join Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
This commit is contained in:
1 parent
40793dc629
commit
643f8110d7
1 file changed
+20
-7
@@ -1208,17 +1208,17 @@ functions:
|
||||
```swift
|
||||
struct City: Decodable {
|
||||
let name: String
|
||||
let countries: [Country]
|
||||
}
|
||||
|
||||
struct Country: Decodable {
|
||||
let name: String
|
||||
let cities: [City]
|
||||
}
|
||||
|
||||
let cities: [City] = try await supabase.database
|
||||
.from("cities")
|
||||
.select("name, countries!inner(name)")
|
||||
.eq("countries.name", value: "Indonesia")
|
||||
let countries: [Country] = try await supabase.database
|
||||
.from("countries")
|
||||
.select("name, cities!inner(name)")
|
||||
.eq("name", value: "united kingdom")
|
||||
.execute()
|
||||
.value
|
||||
```
|
||||
@@ -1251,8 +1251,21 @@ functions:
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"name": "Bali",
|
||||
"countries": {"name": "Indonesia"}
|
||||
"name": "united kingdom",
|
||||
"cities": [
|
||||
{
|
||||
"name": "London"
|
||||
},
|
||||
{
|
||||
"name": "Manchester"
|
||||
},
|
||||
{
|
||||
"name": "Liverpool"
|
||||
},
|
||||
{
|
||||
"name": "Bristol"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": 200,
|
||||
|
||||
Reference in new issue
Block a user