queryer: array containment fires on punc-response paths — compile_array hands the entity node the ITEMS PROXY as its schema (no properties), so property-shape checks that read node.schema silently missed; fall back to the type's own schema (Type.schemas[name]). Fixture adds get_people punc + containment/cast filters through it. Live case: get_vendors trade filter still compiled =::jsonb after 1.0.174.
This commit is contained in:
@ -70,6 +70,17 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "get_people",
|
||||
"schemas": {
|
||||
"get_people.response": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "person"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"enums": [],
|
||||
@ -2731,6 +2742,55 @@
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Punc response items proxy: jsonb array containment filter falls back to the type schema",
|
||||
"action": "query",
|
||||
"schema_id": "get_people.response",
|
||||
"filter": {
|
||||
"tags": {
|
||||
"$eq": "landscaping"
|
||||
},
|
||||
"labels": {
|
||||
"$of": [
|
||||
"vip",
|
||||
"board"
|
||||
]
|
||||
},
|
||||
"rating": {
|
||||
"$gte": 4.0
|
||||
}
|
||||
},
|
||||
"expect": {
|
||||
"success": true,
|
||||
"sql": [
|
||||
[
|
||||
"((SELECT jsonb_strip_nulls((",
|
||||
" SELECT COALESCE(jsonb_agg(jsonb_build_object(",
|
||||
" 'id', entity_1.id,",
|
||||
" 'type', entity_1.type,",
|
||||
" 'archived', entity_1.archived,",
|
||||
" 'created_at', entity_1.created_at,",
|
||||
" 'name', organization_2.name,",
|
||||
" 'first_name', person_3.first_name,",
|
||||
" 'last_name', person_3.last_name,",
|
||||
" 'age', person_3.age,",
|
||||
" 'rating', person_3.rating,",
|
||||
" 'tags', person_3.tags,",
|
||||
" 'labels', person_3.labels",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_1",
|
||||
" JOIN agreego.organization organization_2",
|
||||
" JOIN agreego.person person_3",
|
||||
" WHERE",
|
||||
" NOT entity_1.archived",
|
||||
" AND person_3.labels ?| ARRAY()",
|
||||
" AND person_3.rating >= ($2 #>> '{}')::NUMERIC",
|
||||
" AND person_3.tags ? ($3 #>> '{)",
|
||||
" ))))"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user