queryer: array-property detection handles the compiled list form — engine-compiled schemas normalize to type:["array"] (SchemaTypeOrArray::Multiple), so the containment branch only fired for hand-written Single("array") schemas and live jsonb array filters fell through to =::jsonb ('Token invalid' at execution). Accept both encodings (array, [array], [array,null]). Fixture pins the list form (labels). Found live: agreego vendor.trade filter.
This commit is contained in:
@ -367,7 +367,8 @@
|
||||
"archived",
|
||||
"created_at",
|
||||
"rating",
|
||||
"tags"
|
||||
"tags",
|
||||
"labels"
|
||||
],
|
||||
"grouped_fields": {
|
||||
"entity": [
|
||||
@ -384,7 +385,8 @@
|
||||
"last_name",
|
||||
"age",
|
||||
"rating",
|
||||
"tags"
|
||||
"tags",
|
||||
"labels"
|
||||
]
|
||||
},
|
||||
"field_types": {
|
||||
@ -397,7 +399,8 @@
|
||||
"age": "numeric",
|
||||
"created_at": "timestamptz",
|
||||
"rating": "float8",
|
||||
"tags": "jsonb"
|
||||
"tags": "jsonb",
|
||||
"labels": "jsonb"
|
||||
},
|
||||
"schemas": {
|
||||
"person": {
|
||||
@ -420,6 +423,16 @@
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
"type": [
|
||||
"array"
|
||||
],
|
||||
"items": {
|
||||
"type": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -440,6 +453,16 @@
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
"type": [
|
||||
"array"
|
||||
],
|
||||
"items": {
|
||||
"type": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -508,6 +531,16 @@
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"labels": {
|
||||
"type": [
|
||||
"array"
|
||||
],
|
||||
"items": {
|
||||
"type": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1325,7 +1358,8 @@
|
||||
" 'last_name', person_3.last_name,",
|
||||
" 'age', person_3.age,",
|
||||
" 'rating', person_3.rating,",
|
||||
" 'tags', person_3.tags",
|
||||
" 'tags', person_3.tags,",
|
||||
" 'labels', person_3.labels",
|
||||
" )",
|
||||
" FROM agreego.entity entity_1",
|
||||
" JOIN agreego.organization organization_2",
|
||||
@ -1357,6 +1391,7 @@
|
||||
" 'age', person_3.age,",
|
||||
" 'rating', person_3.rating,",
|
||||
" 'tags', person_3.tags,",
|
||||
" 'labels', person_3.labels,",
|
||||
" 'phone_numbers', (",
|
||||
" SELECT COALESCE(jsonb_agg(jsonb_build_object(",
|
||||
" 'id', entity_4.id,",
|
||||
@ -1609,6 +1644,7 @@
|
||||
" 'age', person_3.age,",
|
||||
" 'rating', person_3.rating,",
|
||||
" 'tags', person_3.tags,",
|
||||
" 'labels', person_3.labels,",
|
||||
" 'phone_numbers', (",
|
||||
" SELECT COALESCE(jsonb_agg(jsonb_build_object(",
|
||||
" 'id', entity_4.id,",
|
||||
@ -1870,7 +1906,8 @@
|
||||
" 'last_name', person_5.last_name,",
|
||||
" 'age', person_5.age,",
|
||||
" 'rating', person_5.rating,",
|
||||
" 'tags', person_5.tags",
|
||||
" 'tags', person_5.tags,",
|
||||
" 'labels', person_5.labels",
|
||||
" )",
|
||||
" FROM agreego.entity entity_3",
|
||||
" JOIN agreego.organization organization_4",
|
||||
@ -1982,7 +2019,8 @@
|
||||
" 'last_name', person_10.last_name,",
|
||||
" 'age', person_10.age,",
|
||||
" 'rating', person_10.rating,",
|
||||
" 'tags', person_10.tags",
|
||||
" 'tags', person_10.tags,",
|
||||
" 'labels', person_10.labels",
|
||||
" )",
|
||||
" FROM agreego.entity entity_8",
|
||||
" JOIN agreego.organization organization_9",
|
||||
@ -2038,7 +2076,8 @@
|
||||
" 'first_name', person_8.first_name,",
|
||||
" 'last_name', person_8.last_name,",
|
||||
" 'rating', person_8.rating,",
|
||||
" 'tags', person_8.tags",
|
||||
" 'tags', person_8.tags,",
|
||||
" 'labels', person_8.labels",
|
||||
" )",
|
||||
" FROM agreego.entity entity_6",
|
||||
" JOIN agreego.organization organization_7",
|
||||
@ -2080,6 +2119,7 @@
|
||||
" 'age', person_5.age,",
|
||||
" 'rating', person_5.rating,",
|
||||
" 'tags', person_5.tags,",
|
||||
" 'labels', person_5.labels,",
|
||||
" 'phone_numbers', (",
|
||||
" SELECT COALESCE(jsonb_agg(jsonb_build_object(",
|
||||
" 'id', entity_6.id,",
|
||||
@ -2276,7 +2316,8 @@
|
||||
" 'last_name', person_5.last_name,",
|
||||
" 'age', person_5.age,",
|
||||
" 'rating', person_5.rating,",
|
||||
" 'tags', person_5.tags",
|
||||
" 'tags', person_5.tags,",
|
||||
" 'labels', person_5.labels",
|
||||
" )",
|
||||
" FROM agreego.entity entity_3",
|
||||
" JOIN agreego.organization organization_4",
|
||||
@ -2461,7 +2502,8 @@
|
||||
" 'last_name', person_12.last_name,",
|
||||
" 'age', person_12.age,",
|
||||
" 'rating', person_12.rating,",
|
||||
" 'tags', person_12.tags",
|
||||
" 'tags', person_12.tags,",
|
||||
" 'labels', person_12.labels",
|
||||
" )",
|
||||
" FROM agreego.entity entity_10",
|
||||
" JOIN agreego.organization organization_11",
|
||||
@ -2503,6 +2545,9 @@
|
||||
"plumbing",
|
||||
"electrical"
|
||||
]
|
||||
},
|
||||
"labels": {
|
||||
"$eq": "vip"
|
||||
}
|
||||
},
|
||||
"expect": {
|
||||
@ -2521,6 +2566,7 @@
|
||||
" 'age', person_3.age,",
|
||||
" 'rating', person_3.rating,",
|
||||
" 'tags', person_3.tags,",
|
||||
" 'labels', person_3.labels,",
|
||||
" 'phone_numbers', (",
|
||||
" SELECT COALESCE(jsonb_agg(jsonb_build_object(",
|
||||
" 'id', entity_4.id,",
|
||||
@ -2677,10 +2723,11 @@
|
||||
" JOIN agreego.person person_3",
|
||||
" WHERE",
|
||||
" NOT entity_1.archived",
|
||||
" AND person_3.rating >= ($1 #>> '{}')::NUMERIC",
|
||||
" AND person_3.tags ? ($2 #>> '{)",
|
||||
" AND person_3.tags ?| ARRAY()",
|
||||
" ))))"
|
||||
" AND person_3.labels ? ($1 #>> '{)",
|
||||
" AND person_3.rating >= ($2 #>> '{}')::NUMERIC",
|
||||
" AND person_3.tags ? ($3 #>> '{)",
|
||||
" AND person_3.tags ?| ARRAY()",
|
||||
" ))))"
|
||||
]
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user