perf: Relationship list to a hash map
This commit is contained in:
committed by
Steve Chavez
parent
e4006da9bc
commit
115dae7484
@@ -27,6 +27,6 @@ spec =
|
||||
request methodGet "/"
|
||||
[("Accept", "application/json")] "" `shouldRespondWith`
|
||||
[json| {
|
||||
"qiSchema":"test","qiName":"has_fk"
|
||||
"qiSchema":"test","qiName":"bars"
|
||||
} |]
|
||||
{ matchHeaders = [matchContentTypeJson] }
|
||||
|
||||
@@ -98,18 +98,18 @@ spec =
|
||||
[json|
|
||||
{
|
||||
"details": [
|
||||
{
|
||||
"cardinality": "many-to-one",
|
||||
"relationship": "agents_department_id_fkey using agents(department_id) and departments(id)",
|
||||
"embedding": "agents with departments"
|
||||
},
|
||||
{
|
||||
"cardinality": "one-to-many",
|
||||
"relationship": "departments_head_id_fkey using agents(id) and departments(head_id)",
|
||||
"embedding": "agents with departments"
|
||||
},
|
||||
{
|
||||
"cardinality": "many-to-one",
|
||||
"relationship": "agents_department_id_fkey using agents(department_id) and departments(id)",
|
||||
"embedding": "agents with departments"
|
||||
}
|
||||
],
|
||||
"hint": "Try changing 'departments' to one of the following: 'departments!agents_department_id_fkey', 'departments!departments_head_id_fkey'. Find the desired relationship in the 'details' key.",
|
||||
"hint": "Try changing 'departments' to one of the following: 'departments!departments_head_id_fkey', 'departments!agents_department_id_fkey'. Find the desired relationship in the 'details' key.",
|
||||
"message": "Could not embed because more than one relationship was found for 'agents' and 'departments'",
|
||||
"code": "PGRST201"
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1843,7 +1843,7 @@ case accept
|
||||
when 'application/openapi+json' then
|
||||
return openapi;
|
||||
when 'application/json' then
|
||||
return (current_setting('request.spec', true)::json)->'dbRelationships'->0->'relTable';
|
||||
return (current_setting('request.spec', true)::json)->'dbRelationships'->0->0;
|
||||
else
|
||||
return openapi;
|
||||
end case;
|
||||
|
||||
Reference in New Issue
Block a user