Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e741a7197f | |||
| cf3cabd1f5 | |||
| d608f5e963 | |||
| 95600551a7 | |||
| c18a8c1561 | |||
| 8ed588ca61 | |||
| edd0dd4763 | |||
| abf1d12e43 | |||
| a885713563 | |||
| d9b4f417f6 | |||
| eae39f92d6 | |||
| 2895f06074 | |||
| c1c16bc814 | |||
| 5885552192 | |||
| dc033296d7 | |||
| 03a871bc1a |
@ -72,8 +72,8 @@
|
||||
{
|
||||
"code": "CONTAINS_VIOLATED",
|
||||
"values": {
|
||||
"limit": "1",
|
||||
"count": "0"
|
||||
"count": "0",
|
||||
"limit": "1"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -177,8 +177,8 @@
|
||||
{
|
||||
"code": "CONTAINS_VIOLATED",
|
||||
"values": {
|
||||
"limit": "1",
|
||||
"count": "0"
|
||||
"count": "0",
|
||||
"limit": "1"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -227,8 +227,8 @@
|
||||
{
|
||||
"code": "CONTAINS_VIOLATED",
|
||||
"values": {
|
||||
"count": "0",
|
||||
"limit": "1"
|
||||
"limit": "1",
|
||||
"count": "0"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -268,8 +268,8 @@
|
||||
{
|
||||
"code": "CONTAINS_VIOLATED",
|
||||
"values": {
|
||||
"count": "0",
|
||||
"limit": "1"
|
||||
"limit": "1",
|
||||
"count": "0"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -384,8 +384,8 @@
|
||||
{
|
||||
"code": "MULTIPLE_OF_VIOLATED",
|
||||
"values": {
|
||||
"value": "9",
|
||||
"multiple_of": "2"
|
||||
"multiple_of": "2",
|
||||
"value": "9"
|
||||
},
|
||||
"details": {
|
||||
"path": "2",
|
||||
@ -443,8 +443,8 @@
|
||||
{
|
||||
"code": "MULTIPLE_OF_VIOLATED",
|
||||
"values": {
|
||||
"multiple_of": "2",
|
||||
"value": "5"
|
||||
"value": "5",
|
||||
"multiple_of": "2"
|
||||
},
|
||||
"details": {
|
||||
"path": "1",
|
||||
|
||||
@ -62,8 +62,8 @@
|
||||
"code": "EDGE_MISSING",
|
||||
"values": {
|
||||
"parent_type": "org",
|
||||
"child_type": "user",
|
||||
"property_name": "missing_users"
|
||||
"property_name": "missing_users",
|
||||
"child_type": "user"
|
||||
},
|
||||
"details": {
|
||||
"path": "full.org/missing_users",
|
||||
@ -151,9 +151,9 @@
|
||||
{
|
||||
"code": "EDGE_MISSING",
|
||||
"values": {
|
||||
"property_name": "children",
|
||||
"child_type": "child",
|
||||
"parent_type": "parent",
|
||||
"child_type": "child"
|
||||
"property_name": "children"
|
||||
},
|
||||
"details": {
|
||||
"path": "full.parent/children",
|
||||
@ -254,9 +254,9 @@
|
||||
{
|
||||
"code": "AMBIGUOUS_TYPE_RELATIONS",
|
||||
"values": {
|
||||
"parent_type": "invoice",
|
||||
"child_type": "activity",
|
||||
"property_name": "activities",
|
||||
"parent_type": "invoice"
|
||||
"property_name": "activities"
|
||||
},
|
||||
"details": {
|
||||
"path": "full.invoice/activities",
|
||||
@ -390,9 +390,9 @@
|
||||
{
|
||||
"code": "AMBIGUOUS_TYPE_RELATIONS",
|
||||
"values": {
|
||||
"property_name": "ambiguous_edge",
|
||||
"parent_type": "actor",
|
||||
"child_type": "junction",
|
||||
"parent_type": "actor"
|
||||
"property_name": "ambiguous_edge"
|
||||
},
|
||||
"details": {
|
||||
"path": "full.actor/ambiguous_edge",
|
||||
@ -470,8 +470,8 @@
|
||||
{
|
||||
"code": "DATABASE_TYPE_PARSE_FAILED",
|
||||
"values": {
|
||||
"type": "failure",
|
||||
"reason": "invalid type: sequence, expected a string"
|
||||
"reason": "invalid type: sequence, expected a string",
|
||||
"type": "failure"
|
||||
},
|
||||
"details": {
|
||||
"context": "failure"
|
||||
|
||||
@ -65,8 +65,8 @@
|
||||
{
|
||||
"code": "DEPENDENCY_MISSING",
|
||||
"values": {
|
||||
"required_property": "foo",
|
||||
"property_name": "bar"
|
||||
"property_name": "bar",
|
||||
"required_property": "foo"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -276,8 +276,8 @@
|
||||
{
|
||||
"code": "DEPENDENCY_MISSING",
|
||||
"values": {
|
||||
"required_property": "foo",
|
||||
"property_name": "quux"
|
||||
"property_name": "quux",
|
||||
"required_property": "foo"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -287,8 +287,8 @@
|
||||
{
|
||||
"code": "DEPENDENCY_MISSING",
|
||||
"values": {
|
||||
"required_property": "bar",
|
||||
"property_name": "quux"
|
||||
"property_name": "quux",
|
||||
"required_property": "bar"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -362,8 +362,8 @@
|
||||
{
|
||||
"code": "DEPENDENCY_MISSING",
|
||||
"values": {
|
||||
"required_property": "foo\rbar",
|
||||
"property_name": "foo\nbar"
|
||||
"property_name": "foo\nbar",
|
||||
"required_property": "foo\rbar"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -829,8 +829,8 @@
|
||||
{
|
||||
"code": "MIN_PROPERTIES_VIOLATED",
|
||||
"values": {
|
||||
"count": "2",
|
||||
"limit": "4"
|
||||
"limit": "4",
|
||||
"count": "2"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
|
||||
@ -128,8 +128,8 @@
|
||||
{
|
||||
"code": "PATTERN_VIOLATED",
|
||||
"values": {
|
||||
"value": "abcd",
|
||||
"pattern": "^[a-z]{3}$"
|
||||
"pattern": "^[a-z]{3}$",
|
||||
"value": "abcd"
|
||||
},
|
||||
"details": {
|
||||
"path": "keys/abcd",
|
||||
|
||||
@ -56,8 +56,8 @@
|
||||
{
|
||||
"code": "EXCLUSIVE_MAXIMUM_VIOLATED",
|
||||
"values": {
|
||||
"limit": "3",
|
||||
"value": "3.5"
|
||||
"value": "3.5",
|
||||
"limit": "3"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
|
||||
@ -34,8 +34,8 @@
|
||||
{
|
||||
"code": "EXCLUSIVE_MINIMUM_VIOLATED",
|
||||
"values": {
|
||||
"value": "1.1",
|
||||
"limit": "1.1"
|
||||
"limit": "1.1",
|
||||
"value": "1.1"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
|
||||
@ -96,14 +96,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"season": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"label": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"opening_hours": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@ -117,6 +109,14 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"season": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"label": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -290,7 +290,6 @@
|
||||
"uuid_field",
|
||||
"tags",
|
||||
"ad_hoc",
|
||||
"schedule",
|
||||
"$and",
|
||||
"$or"
|
||||
],
|
||||
@ -306,7 +305,6 @@
|
||||
"uuid_field",
|
||||
"tags",
|
||||
"ad_hoc",
|
||||
"schedule",
|
||||
"$and",
|
||||
"$or"
|
||||
],
|
||||
@ -328,7 +326,6 @@
|
||||
"uuid_field",
|
||||
"tags",
|
||||
"ad_hoc",
|
||||
"schedule",
|
||||
"$and",
|
||||
"$or"
|
||||
],
|
||||
@ -397,41 +394,6 @@
|
||||
"string.condition",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"schedule": {
|
||||
"type": [
|
||||
"filter",
|
||||
"null"
|
||||
],
|
||||
"compiledPropertyNames": [
|
||||
"open",
|
||||
"seasons"
|
||||
],
|
||||
"properties": {
|
||||
"open": {
|
||||
"type": [
|
||||
"string.condition",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"seasons": {
|
||||
"type": [
|
||||
"filter",
|
||||
"null"
|
||||
],
|
||||
"compiledPropertyNames": [
|
||||
"label"
|
||||
],
|
||||
"properties": {
|
||||
"label": {
|
||||
"type": [
|
||||
"string.condition",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "filter"
|
||||
@ -557,4 +519,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
File diff suppressed because it is too large
Load Diff
@ -70,8 +70,8 @@
|
||||
{
|
||||
"code": "CONTAINS_VIOLATED",
|
||||
"values": {
|
||||
"limit": "1",
|
||||
"count": "0"
|
||||
"count": "0",
|
||||
"limit": "1"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -144,8 +144,8 @@
|
||||
{
|
||||
"code": "CONTAINS_VIOLATED",
|
||||
"values": {
|
||||
"count": "2",
|
||||
"limit": "1"
|
||||
"limit": "1",
|
||||
"count": "2"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
|
||||
@ -43,8 +43,8 @@
|
||||
{
|
||||
"code": "MAX_LENGTH_VIOLATED",
|
||||
"values": {
|
||||
"count": "3",
|
||||
"limit": "2"
|
||||
"limit": "2",
|
||||
"count": "3"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -109,8 +109,8 @@
|
||||
{
|
||||
"code": "MAX_LENGTH_VIOLATED",
|
||||
"values": {
|
||||
"count": "3",
|
||||
"limit": "2"
|
||||
"limit": "2",
|
||||
"count": "3"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
|
||||
@ -139,8 +139,8 @@
|
||||
{
|
||||
"code": "MAX_PROPERTIES_VIOLATED",
|
||||
"values": {
|
||||
"count": "3",
|
||||
"limit": "2"
|
||||
"limit": "2",
|
||||
"count": "3"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -190,8 +190,8 @@
|
||||
{
|
||||
"code": "MAX_PROPERTIES_VIOLATED",
|
||||
"values": {
|
||||
"count": "1",
|
||||
"limit": "0"
|
||||
"limit": "0",
|
||||
"count": "1"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -234,8 +234,8 @@
|
||||
{
|
||||
"code": "MAX_PROPERTIES_VIOLATED",
|
||||
"values": {
|
||||
"limit": "2",
|
||||
"count": "3"
|
||||
"count": "3",
|
||||
"limit": "2"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
|
||||
@ -43,8 +43,8 @@
|
||||
{
|
||||
"code": "MAXIMUM_VIOLATED",
|
||||
"values": {
|
||||
"limit": "3",
|
||||
"value": "3.5"
|
||||
"value": "3.5",
|
||||
"limit": "3"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -118,8 +118,8 @@
|
||||
{
|
||||
"code": "MAXIMUM_VIOLATED",
|
||||
"values": {
|
||||
"value": "300.5",
|
||||
"limit": "300"
|
||||
"limit": "300",
|
||||
"value": "300.5"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
|
||||
@ -264,8 +264,8 @@
|
||||
{
|
||||
"code": "DEPENDENCY_MISSING",
|
||||
"values": {
|
||||
"required_property": "child_dep",
|
||||
"property_name": "trigger"
|
||||
"property_name": "trigger",
|
||||
"required_property": "child_dep"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
|
||||
@ -1310,9 +1310,9 @@
|
||||
[
|
||||
"(SELECT to_jsonb(t1.*) || to_jsonb(t2.*) || to_jsonb(t3.*) || to_jsonb(t4.*)",
|
||||
"FROM agreego.\"entity\" t1",
|
||||
"JOIN agreego.\"organization\" t2 ON ",
|
||||
"JOIN agreego.\"user\" t3 ON ",
|
||||
"JOIN agreego.\"person\" t4 ON ",
|
||||
"LEFT JOIN agreego.\"organization\" t2 ON t2.id = t1.id",
|
||||
"LEFT JOIN agreego.\"user\" t3 ON t3.id = t1.id",
|
||||
"LEFT JOIN agreego.\"person\" t4 ON t4.id = t1.id",
|
||||
"WHERE",
|
||||
" (\"first_name\" = 'LookupFirst'",
|
||||
" AND \"last_name\" = 'LookupLast'",
|
||||
@ -1463,12 +1463,18 @@
|
||||
[
|
||||
"(SELECT to_jsonb(t1.*) || to_jsonb(t2.*) || to_jsonb(t3.*) || to_jsonb(t4.*)",
|
||||
"FROM agreego.\"entity\" t1",
|
||||
"JOIN agreego.\"organization\" t2 ON ",
|
||||
"JOIN agreego.\"user\" t3 ON ",
|
||||
"JOIN agreego.\"person\" t4 ON ",
|
||||
"LEFT JOIN agreego.\"organization\" t2 ON t2.id = t1.id",
|
||||
"LEFT JOIN agreego.\"user\" t3 ON t3.id = t1.id",
|
||||
"LEFT JOIN agreego.\"person\" t4 ON t4.id = t1.id",
|
||||
"WHERE",
|
||||
" t1.id = '{{uuid:data.id}}'",
|
||||
" OR (\"first_name\" = 'LookupFirst'",
|
||||
"UNION SELECT to_jsonb(t1.*) || to_jsonb(t2.*) || to_jsonb(t3.*) || to_jsonb(t4.*)",
|
||||
"FROM agreego.\"entity\" t1",
|
||||
"LEFT JOIN agreego.\"organization\" t2 ON t2.id = t1.id",
|
||||
"LEFT JOIN agreego.\"user\" t3 ON t3.id = t1.id",
|
||||
"LEFT JOIN agreego.\"person\" t4 ON t4.id = t1.id",
|
||||
"WHERE",
|
||||
" (\"first_name\" = 'LookupFirst'",
|
||||
" AND \"last_name\" = 'LookupLast'",
|
||||
" AND \"date_of_birth\" = '{{timestamp}}'",
|
||||
" AND \"pronouns\" = 'they/them'))"
|
||||
@ -1616,12 +1622,18 @@
|
||||
[
|
||||
"(SELECT to_jsonb(t1.*) || to_jsonb(t2.*) || to_jsonb(t3.*) || to_jsonb(t4.*)",
|
||||
"FROM agreego.\"entity\" t1",
|
||||
"JOIN agreego.\"organization\" t2 ON ",
|
||||
"JOIN agreego.\"user\" t3 ON ",
|
||||
"JOIN agreego.\"person\" t4 ON ",
|
||||
"LEFT JOIN agreego.\"organization\" t2 ON t2.id = t1.id",
|
||||
"LEFT JOIN agreego.\"user\" t3 ON t3.id = t1.id",
|
||||
"LEFT JOIN agreego.\"person\" t4 ON t4.id = t1.id",
|
||||
"WHERE",
|
||||
" t1.id = '{{uuid:data.id}}'",
|
||||
" OR (\"first_name\" = 'LookupFirst'",
|
||||
"UNION SELECT to_jsonb(t1.*) || to_jsonb(t2.*) || to_jsonb(t3.*) || to_jsonb(t4.*)",
|
||||
"FROM agreego.\"entity\" t1",
|
||||
"LEFT JOIN agreego.\"organization\" t2 ON t2.id = t1.id",
|
||||
"LEFT JOIN agreego.\"user\" t3 ON t3.id = t1.id",
|
||||
"LEFT JOIN agreego.\"person\" t4 ON t4.id = t1.id",
|
||||
"WHERE",
|
||||
" (\"first_name\" = 'LookupFirst'",
|
||||
" AND \"last_name\" = 'LookupLast'",
|
||||
" AND \"date_of_birth\" = '{{timestamp}}'",
|
||||
" AND \"pronouns\" = 'they/them'))"
|
||||
@ -1759,9 +1771,9 @@
|
||||
[
|
||||
"(SELECT to_jsonb(t1.*) || to_jsonb(t2.*) || to_jsonb(t3.*) || to_jsonb(t4.*)",
|
||||
"FROM agreego.\"entity\" t1",
|
||||
"JOIN agreego.\"organization\" t2 ON ",
|
||||
"JOIN agreego.\"user\" t3 ON ",
|
||||
"JOIN agreego.\"person\" t4 ON ",
|
||||
"LEFT JOIN agreego.\"organization\" t2 ON t2.id = t1.id",
|
||||
"LEFT JOIN agreego.\"user\" t3 ON t3.id = t1.id",
|
||||
"LEFT JOIN agreego.\"person\" t4 ON t4.id = t1.id",
|
||||
"WHERE",
|
||||
" t1.id = '{{uuid:mocks.0.id}}')"
|
||||
],
|
||||
@ -1882,9 +1894,9 @@
|
||||
[
|
||||
"(SELECT to_jsonb(t1.*) || to_jsonb(t2.*) || to_jsonb(t3.*) || to_jsonb(t4.*)",
|
||||
"FROM agreego.\"entity\" t1",
|
||||
"JOIN agreego.\"organization\" t2 ON ",
|
||||
"JOIN agreego.\"user\" t3 ON ",
|
||||
"JOIN agreego.\"person\" t4 ON ",
|
||||
"LEFT JOIN agreego.\"organization\" t2 ON t2.id = t1.id",
|
||||
"LEFT JOIN agreego.\"user\" t3 ON t3.id = t1.id",
|
||||
"LEFT JOIN agreego.\"person\" t4 ON t4.id = t1.id",
|
||||
"WHERE",
|
||||
" t1.id = '123')"
|
||||
],
|
||||
@ -2221,10 +2233,14 @@
|
||||
[
|
||||
"(SELECT to_jsonb(t1.*) || to_jsonb(t2.*)",
|
||||
"FROM agreego.\"entity\" t1",
|
||||
"JOIN agreego.\"order\" t2 ON ",
|
||||
"LEFT JOIN agreego.\"order\" t2 ON t2.id = t1.id",
|
||||
"WHERE",
|
||||
" t1.id = 'abc'",
|
||||
" OR (\"id\" = 'abc'))"
|
||||
"UNION SELECT to_jsonb(t1.*) || to_jsonb(t2.*)",
|
||||
"FROM agreego.\"entity\" t1",
|
||||
"LEFT JOIN agreego.\"order\" t2 ON t2.id = t1.id",
|
||||
"WHERE",
|
||||
" (\"id\" = 'abc'))"
|
||||
],
|
||||
[
|
||||
"INSERT INTO agreego.\"entity\" (",
|
||||
@ -3024,9 +3040,9 @@
|
||||
[
|
||||
"(SELECT to_jsonb(t1.*) || to_jsonb(t2.*) || to_jsonb(t3.*) || to_jsonb(t4.*)",
|
||||
"FROM agreego.\"entity\" t1",
|
||||
"JOIN agreego.\"organization\" t2 ON ",
|
||||
"JOIN agreego.\"user\" t3 ON ",
|
||||
"JOIN agreego.\"person\" t4 ON ",
|
||||
"LEFT JOIN agreego.\"organization\" t2 ON t2.id = t1.id",
|
||||
"LEFT JOIN agreego.\"user\" t3 ON t3.id = t1.id",
|
||||
"LEFT JOIN agreego.\"person\" t4 ON t4.id = t1.id",
|
||||
"WHERE",
|
||||
" t1.id = 'abc-archived')"
|
||||
],
|
||||
@ -3377,7 +3393,7 @@
|
||||
[
|
||||
"(SELECT to_jsonb(t1.*) || to_jsonb(t2.*)",
|
||||
"FROM agreego.\"entity\" t1",
|
||||
"JOIN agreego.\"order_line\" t2 ON ",
|
||||
"LEFT JOIN agreego.\"order_line\" t2 ON t2.id = t1.id",
|
||||
"WHERE",
|
||||
" t1.id = '{{uuid:data.lines.0.id}}')"
|
||||
],
|
||||
@ -3501,10 +3517,14 @@
|
||||
[
|
||||
"(SELECT to_jsonb(t1.*) || to_jsonb(t2.*)",
|
||||
"FROM agreego.\"entity\" t1",
|
||||
"JOIN agreego.\"invoice\" t2 ON ",
|
||||
"LEFT JOIN agreego.\"invoice\" t2 ON t2.id = t1.id",
|
||||
"WHERE",
|
||||
" t1.id = '{{uuid:data.id}}'",
|
||||
" OR (\"id\" = '{{uuid:data.id}}'))"
|
||||
"UNION SELECT to_jsonb(t1.*) || to_jsonb(t2.*)",
|
||||
"FROM agreego.\"entity\" t1",
|
||||
"LEFT JOIN agreego.\"invoice\" t2 ON t2.id = t1.id",
|
||||
"WHERE",
|
||||
" (\"id\" = '{{uuid:data.id}}'))"
|
||||
],
|
||||
[
|
||||
"INSERT INTO agreego.\"entity\" (",
|
||||
@ -3618,7 +3638,7 @@
|
||||
[
|
||||
"(SELECT to_jsonb(t1.*) || to_jsonb(t2.*)",
|
||||
"FROM agreego.\"entity\" t1",
|
||||
"JOIN agreego.\"account\" t2 ON ",
|
||||
"LEFT JOIN agreego.\"account\" t2 ON t2.id = t1.id",
|
||||
"WHERE",
|
||||
" t1.id = '{{uuid:data.id}}')"
|
||||
],
|
||||
|
||||
@ -67,8 +67,8 @@
|
||||
{
|
||||
"code": "CONTAINS_VIOLATED",
|
||||
"values": {
|
||||
"limit": "1",
|
||||
"count": "0"
|
||||
"count": "0",
|
||||
"limit": "1"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -91,8 +91,8 @@
|
||||
{
|
||||
"code": "CONTAINS_VIOLATED",
|
||||
"values": {
|
||||
"limit": "1",
|
||||
"count": "0"
|
||||
"count": "0",
|
||||
"limit": "1"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -218,8 +218,8 @@
|
||||
{
|
||||
"code": "CONTAINS_VIOLATED",
|
||||
"values": {
|
||||
"limit": "2",
|
||||
"count": "1"
|
||||
"count": "1",
|
||||
"limit": "2"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -357,8 +357,8 @@
|
||||
{
|
||||
"code": "CONTAINS_VIOLATED",
|
||||
"values": {
|
||||
"count": "0",
|
||||
"limit": "2"
|
||||
"limit": "2",
|
||||
"count": "0"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -381,8 +381,8 @@
|
||||
{
|
||||
"code": "CONTAINS_VIOLATED",
|
||||
"values": {
|
||||
"limit": "2",
|
||||
"count": "1"
|
||||
"count": "1",
|
||||
"limit": "2"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -407,8 +407,8 @@
|
||||
{
|
||||
"code": "CONTAINS_VIOLATED",
|
||||
"values": {
|
||||
"limit": "2",
|
||||
"count": "3"
|
||||
"count": "3",
|
||||
"limit": "2"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -463,8 +463,8 @@
|
||||
{
|
||||
"code": "CONTAINS_VIOLATED",
|
||||
"values": {
|
||||
"count": "0",
|
||||
"limit": "3"
|
||||
"limit": "3",
|
||||
"count": "0"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -487,8 +487,8 @@
|
||||
{
|
||||
"code": "CONTAINS_VIOLATED",
|
||||
"values": {
|
||||
"count": "1",
|
||||
"limit": "3"
|
||||
"limit": "3",
|
||||
"count": "1"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -513,8 +513,8 @@
|
||||
{
|
||||
"code": "CONTAINS_VIOLATED",
|
||||
"values": {
|
||||
"count": "3",
|
||||
"limit": "1"
|
||||
"limit": "1",
|
||||
"count": "3"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -538,8 +538,8 @@
|
||||
{
|
||||
"code": "CONTAINS_VIOLATED",
|
||||
"values": {
|
||||
"limit": "3",
|
||||
"count": "2"
|
||||
"count": "2",
|
||||
"limit": "3"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -549,8 +549,8 @@
|
||||
{
|
||||
"code": "CONTAINS_VIOLATED",
|
||||
"values": {
|
||||
"limit": "1",
|
||||
"count": "2"
|
||||
"count": "2",
|
||||
"limit": "1"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -657,8 +657,8 @@
|
||||
{
|
||||
"code": "CONTAINS_VIOLATED",
|
||||
"values": {
|
||||
"count": "2",
|
||||
"limit": "1"
|
||||
"limit": "1",
|
||||
"count": "2"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
|
||||
@ -48,8 +48,8 @@
|
||||
{
|
||||
"code": "MIN_ITEMS_VIOLATED",
|
||||
"values": {
|
||||
"limit": "1",
|
||||
"count": "0"
|
||||
"count": "0",
|
||||
"limit": "1"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -108,8 +108,8 @@
|
||||
{
|
||||
"code": "MIN_ITEMS_VIOLATED",
|
||||
"values": {
|
||||
"count": "0",
|
||||
"limit": "1"
|
||||
"limit": "1",
|
||||
"count": "0"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
|
||||
@ -43,8 +43,8 @@
|
||||
{
|
||||
"code": "MINIMUM_VIOLATED",
|
||||
"values": {
|
||||
"value": "0.6",
|
||||
"limit": "1.1"
|
||||
"limit": "1.1",
|
||||
"value": "0.6"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -127,8 +127,8 @@
|
||||
{
|
||||
"code": "MINIMUM_VIOLATED",
|
||||
"values": {
|
||||
"value": "-2.0001",
|
||||
"limit": "-2"
|
||||
"limit": "-2",
|
||||
"value": "-2.0001"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
|
||||
@ -100,8 +100,8 @@
|
||||
{
|
||||
"code": "MULTIPLE_OF_VIOLATED",
|
||||
"values": {
|
||||
"multiple_of": "1.5",
|
||||
"value": "35"
|
||||
"value": "35",
|
||||
"multiple_of": "1.5"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -148,8 +148,8 @@
|
||||
{
|
||||
"code": "MULTIPLE_OF_VIOLATED",
|
||||
"values": {
|
||||
"value": "0.00751",
|
||||
"multiple_of": "0.0001"
|
||||
"multiple_of": "0.0001",
|
||||
"value": "0.00751"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
|
||||
@ -156,8 +156,8 @@
|
||||
{
|
||||
"code": "MAXIMUM_VIOLATED",
|
||||
"values": {
|
||||
"value": "60",
|
||||
"limit": "50"
|
||||
"limit": "50",
|
||||
"value": "60"
|
||||
},
|
||||
"details": {
|
||||
"path": "max",
|
||||
|
||||
@ -34,8 +34,8 @@
|
||||
{
|
||||
"code": "PATTERN_VIOLATED",
|
||||
"values": {
|
||||
"pattern": "^a*$",
|
||||
"value": "abc"
|
||||
"value": "abc",
|
||||
"pattern": "^a*$"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
|
||||
@ -148,8 +148,8 @@
|
||||
{
|
||||
"code": "NO_FAMILY_MATCH",
|
||||
"values": {
|
||||
"discriminator": "type",
|
||||
"value": "alien"
|
||||
"value": "alien",
|
||||
"discriminator": "type"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -284,8 +284,8 @@
|
||||
{
|
||||
"code": "NO_FAMILY_MATCH",
|
||||
"values": {
|
||||
"discriminator": "type",
|
||||
"value": "bot"
|
||||
"value": "bot",
|
||||
"discriminator": "type"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
|
||||
@ -43,8 +43,8 @@
|
||||
{
|
||||
"code": "MAX_LENGTH_VIOLATED",
|
||||
"values": {
|
||||
"limit": "3",
|
||||
"count": "6"
|
||||
"count": "6",
|
||||
"limit": "3"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
@ -431,8 +431,8 @@
|
||||
{
|
||||
"code": "MAX_LENGTH_VIOLATED",
|
||||
"values": {
|
||||
"count": "6",
|
||||
"limit": "3"
|
||||
"limit": "3",
|
||||
"count": "6"
|
||||
},
|
||||
"details": {
|
||||
"path": "",
|
||||
|
||||
@ -365,7 +365,9 @@
|
||||
"name",
|
||||
"age",
|
||||
"archived",
|
||||
"created_at"
|
||||
"created_at",
|
||||
"rating",
|
||||
"tags"
|
||||
],
|
||||
"grouped_fields": {
|
||||
"entity": [
|
||||
@ -380,7 +382,9 @@
|
||||
"person": [
|
||||
"first_name",
|
||||
"last_name",
|
||||
"age"
|
||||
"age",
|
||||
"rating",
|
||||
"tags"
|
||||
]
|
||||
},
|
||||
"field_types": {
|
||||
@ -391,7 +395,9 @@
|
||||
"last_name": "text",
|
||||
"name": "text",
|
||||
"age": "numeric",
|
||||
"created_at": "timestamptz"
|
||||
"created_at": "timestamptz",
|
||||
"rating": "float8",
|
||||
"tags": "jsonb"
|
||||
},
|
||||
"schemas": {
|
||||
"person": {
|
||||
@ -405,6 +411,15 @@
|
||||
},
|
||||
"age": {
|
||||
"type": "number"
|
||||
},
|
||||
"rating": {
|
||||
"type": "number"
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -416,6 +431,15 @@
|
||||
},
|
||||
"last_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"rating": {
|
||||
"type": "number"
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -475,6 +499,15 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"rating": {
|
||||
"type": "number"
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1290,11 +1323,13 @@
|
||||
" 'name', organization_2.name,",
|
||||
" 'first_name', person_3.first_name,",
|
||||
" 'last_name', person_3.last_name,",
|
||||
" 'age', person_3.age",
|
||||
" 'age', person_3.age,",
|
||||
" 'rating', person_3.rating,",
|
||||
" 'tags', person_3.tags",
|
||||
" )",
|
||||
" FROM agreego.entity entity_1",
|
||||
" JOIN agreego.organization organization_2 ON organization_2.id = entity_1.id",
|
||||
" JOIN agreego.person person_3 ON person_3.id = organization_2.id",
|
||||
" JOIN agreego.organization organization_2",
|
||||
" JOIN agreego.person person_3",
|
||||
" WHERE",
|
||||
" NOT entity_1.archived",
|
||||
"))))"
|
||||
@ -1320,6 +1355,8 @@
|
||||
" 'first_name', person_3.first_name,",
|
||||
" 'last_name', person_3.last_name,",
|
||||
" 'age', person_3.age,",
|
||||
" 'rating', person_3.rating,",
|
||||
" 'tags', person_3.tags,",
|
||||
" 'phone_numbers', (",
|
||||
" SELECT COALESCE(jsonb_agg(jsonb_build_object(",
|
||||
" 'id', entity_4.id,",
|
||||
@ -1336,15 +1373,15 @@
|
||||
" 'number', phone_number_8.number",
|
||||
" )",
|
||||
" FROM agreego.entity entity_7",
|
||||
" JOIN agreego.phone_number phone_number_8 ON phone_number_8.id = entity_7.id",
|
||||
" JOIN agreego.phone_number phone_number_8",
|
||||
" WHERE",
|
||||
" NOT entity_7.archived",
|
||||
" AND relationship_5.target_id = entity_7.id",
|
||||
" )",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_4",
|
||||
" JOIN agreego.relationship relationship_5 ON relationship_5.id = entity_4.id",
|
||||
" JOIN agreego.contact contact_6 ON contact_6.id = relationship_5.id",
|
||||
" JOIN agreego.relationship relationship_5",
|
||||
" JOIN agreego.contact contact_6",
|
||||
" WHERE",
|
||||
" NOT entity_4.archived",
|
||||
" AND relationship_5.target_type = 'phone_number'",
|
||||
@ -1366,15 +1403,15 @@
|
||||
" 'address', email_address_13.address",
|
||||
" )",
|
||||
" FROM agreego.entity entity_12",
|
||||
" JOIN agreego.email_address email_address_13 ON email_address_13.id = entity_12.id",
|
||||
" JOIN agreego.email_address email_address_13",
|
||||
" WHERE",
|
||||
" NOT entity_12.archived",
|
||||
" AND relationship_10.target_id = entity_12.id",
|
||||
" )",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_9",
|
||||
" JOIN agreego.relationship relationship_10 ON relationship_10.id = entity_9.id",
|
||||
" JOIN agreego.contact contact_11 ON contact_11.id = relationship_10.id",
|
||||
" JOIN agreego.relationship relationship_10",
|
||||
" JOIN agreego.contact contact_11",
|
||||
" WHERE",
|
||||
" NOT entity_9.archived",
|
||||
" AND relationship_10.target_type = 'email_address'",
|
||||
@ -1396,15 +1433,15 @@
|
||||
" 'city', address_18.city",
|
||||
" )",
|
||||
" FROM agreego.entity entity_17",
|
||||
" JOIN agreego.address address_18 ON address_18.id = entity_17.id",
|
||||
" JOIN agreego.address address_18",
|
||||
" WHERE",
|
||||
" NOT entity_17.archived",
|
||||
" AND relationship_15.target_id = entity_17.id",
|
||||
" )",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_14",
|
||||
" JOIN agreego.relationship relationship_15 ON relationship_15.id = entity_14.id",
|
||||
" JOIN agreego.contact contact_16 ON contact_16.id = relationship_15.id",
|
||||
" JOIN agreego.relationship relationship_15",
|
||||
" JOIN agreego.contact contact_16",
|
||||
" WHERE",
|
||||
" NOT entity_14.archived",
|
||||
" AND relationship_15.target_type = 'address'",
|
||||
@ -1427,7 +1464,7 @@
|
||||
" 'number', phone_number_23.number",
|
||||
" )",
|
||||
" FROM agreego.entity entity_22",
|
||||
" JOIN agreego.phone_number phone_number_23 ON phone_number_23.id = entity_22.id",
|
||||
" JOIN agreego.phone_number phone_number_23",
|
||||
" WHERE",
|
||||
" NOT entity_22.archived",
|
||||
" AND relationship_20.target_id = entity_22.id",
|
||||
@ -1441,7 +1478,7 @@
|
||||
" 'address', email_address_25.address",
|
||||
" )",
|
||||
" FROM agreego.entity entity_24",
|
||||
" JOIN agreego.email_address email_address_25 ON email_address_25.id = entity_24.id",
|
||||
" JOIN agreego.email_address email_address_25",
|
||||
" WHERE",
|
||||
" NOT entity_24.archived",
|
||||
" AND relationship_20.target_id = entity_24.id",
|
||||
@ -1455,7 +1492,7 @@
|
||||
" 'city', address_27.city",
|
||||
" )",
|
||||
" FROM agreego.entity entity_26",
|
||||
" JOIN agreego.address address_27 ON address_27.id = entity_26.id",
|
||||
" JOIN agreego.address address_27",
|
||||
" WHERE",
|
||||
" NOT entity_26.archived",
|
||||
" AND relationship_20.target_id = entity_26.id",
|
||||
@ -1464,16 +1501,16 @@
|
||||
" END",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_19",
|
||||
" JOIN agreego.relationship relationship_20 ON relationship_20.id = entity_19.id",
|
||||
" JOIN agreego.contact contact_21 ON contact_21.id = relationship_20.id",
|
||||
" JOIN agreego.relationship relationship_20",
|
||||
" JOIN agreego.contact contact_21",
|
||||
" WHERE",
|
||||
" NOT entity_19.archived",
|
||||
" AND relationship_20.source_id = entity_1.id",
|
||||
" )",
|
||||
" )",
|
||||
" FROM agreego.entity entity_1",
|
||||
" JOIN agreego.organization organization_2 ON organization_2.id = entity_1.id",
|
||||
" JOIN agreego.person person_3 ON person_3.id = organization_2.id",
|
||||
" JOIN agreego.organization organization_2",
|
||||
" JOIN agreego.person person_3",
|
||||
" WHERE",
|
||||
" NOT entity_1.archived",
|
||||
"))))"
|
||||
@ -1570,6 +1607,8 @@
|
||||
" 'first_name', person_3.first_name,",
|
||||
" 'last_name', person_3.last_name,",
|
||||
" 'age', person_3.age,",
|
||||
" 'rating', person_3.rating,",
|
||||
" 'tags', person_3.tags,",
|
||||
" 'phone_numbers', (",
|
||||
" SELECT COALESCE(jsonb_agg(jsonb_build_object(",
|
||||
" 'id', entity_4.id,",
|
||||
@ -1586,7 +1625,7 @@
|
||||
" 'number', phone_number_8.number",
|
||||
" )",
|
||||
" FROM agreego.entity entity_7",
|
||||
" JOIN agreego.phone_number phone_number_8 ON phone_number_8.id = entity_7.id",
|
||||
" JOIN agreego.phone_number phone_number_8",
|
||||
" WHERE",
|
||||
" NOT entity_7.archived",
|
||||
" AND phone_number_8.number ILIKE $32 #>> '{}'",
|
||||
@ -1594,8 +1633,8 @@
|
||||
" )",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_4",
|
||||
" JOIN agreego.relationship relationship_5 ON relationship_5.id = entity_4.id",
|
||||
" JOIN agreego.contact contact_6 ON contact_6.id = relationship_5.id",
|
||||
" JOIN agreego.relationship relationship_5",
|
||||
" JOIN agreego.contact contact_6",
|
||||
" WHERE",
|
||||
" NOT entity_4.archived",
|
||||
" AND relationship_5.target_type = 'phone_number'",
|
||||
@ -1617,15 +1656,15 @@
|
||||
" 'address', email_address_13.address",
|
||||
" )",
|
||||
" FROM agreego.entity entity_12",
|
||||
" JOIN agreego.email_address email_address_13 ON email_address_13.id = entity_12.id",
|
||||
" JOIN agreego.email_address email_address_13",
|
||||
" WHERE",
|
||||
" NOT entity_12.archived",
|
||||
" AND relationship_10.target_id = entity_12.id",
|
||||
" )",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_9",
|
||||
" JOIN agreego.relationship relationship_10 ON relationship_10.id = entity_9.id",
|
||||
" JOIN agreego.contact contact_11 ON contact_11.id = relationship_10.id",
|
||||
" JOIN agreego.relationship relationship_10",
|
||||
" JOIN agreego.contact contact_11",
|
||||
" WHERE",
|
||||
" NOT entity_9.archived",
|
||||
" AND relationship_10.target_type = 'email_address'",
|
||||
@ -1647,15 +1686,15 @@
|
||||
" 'city', address_18.city",
|
||||
" )",
|
||||
" FROM agreego.entity entity_17",
|
||||
" JOIN agreego.address address_18 ON address_18.id = entity_17.id",
|
||||
" JOIN agreego.address address_18",
|
||||
" WHERE",
|
||||
" NOT entity_17.archived",
|
||||
" AND relationship_15.target_id = entity_17.id",
|
||||
" )",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_14",
|
||||
" JOIN agreego.relationship relationship_15 ON relationship_15.id = entity_14.id",
|
||||
" JOIN agreego.contact contact_16 ON contact_16.id = relationship_15.id",
|
||||
" JOIN agreego.relationship relationship_15",
|
||||
" JOIN agreego.contact contact_16",
|
||||
" WHERE",
|
||||
" NOT entity_14.archived",
|
||||
" AND relationship_15.target_type = 'address'",
|
||||
@ -1678,7 +1717,7 @@
|
||||
" 'number', phone_number_23.number",
|
||||
" )",
|
||||
" FROM agreego.entity entity_22",
|
||||
" JOIN agreego.phone_number phone_number_23 ON phone_number_23.id = entity_22.id",
|
||||
" JOIN agreego.phone_number phone_number_23",
|
||||
" WHERE",
|
||||
" NOT entity_22.archived",
|
||||
" AND relationship_20.target_id = entity_22.id",
|
||||
@ -1692,7 +1731,7 @@
|
||||
" 'address', email_address_25.address",
|
||||
" )",
|
||||
" FROM agreego.entity entity_24",
|
||||
" JOIN agreego.email_address email_address_25 ON email_address_25.id = entity_24.id",
|
||||
" JOIN agreego.email_address email_address_25",
|
||||
" WHERE",
|
||||
" NOT entity_24.archived",
|
||||
" AND relationship_20.target_id = entity_24.id",
|
||||
@ -1706,7 +1745,7 @@
|
||||
" 'city', address_27.city",
|
||||
" )",
|
||||
" FROM agreego.entity entity_26",
|
||||
" JOIN agreego.address address_27 ON address_27.id = entity_26.id",
|
||||
" JOIN agreego.address address_27",
|
||||
" WHERE",
|
||||
" NOT entity_26.archived",
|
||||
" AND relationship_20.target_id = entity_26.id",
|
||||
@ -1715,8 +1754,8 @@
|
||||
" END",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_19",
|
||||
" JOIN agreego.relationship relationship_20 ON relationship_20.id = entity_19.id",
|
||||
" JOIN agreego.contact contact_21 ON contact_21.id = relationship_20.id",
|
||||
" JOIN agreego.relationship relationship_20",
|
||||
" JOIN agreego.contact contact_21",
|
||||
" WHERE",
|
||||
" NOT entity_19.archived",
|
||||
" AND contact_21.is_primary = ($11 #>> '{}')::BOOLEAN",
|
||||
@ -1724,8 +1763,8 @@
|
||||
" )",
|
||||
" )",
|
||||
" FROM agreego.entity entity_1",
|
||||
" JOIN agreego.organization organization_2 ON organization_2.id = entity_1.id",
|
||||
" JOIN agreego.person person_3 ON person_3.id = organization_2.id",
|
||||
" JOIN agreego.organization organization_2",
|
||||
" JOIN agreego.person person_3",
|
||||
" WHERE",
|
||||
" NOT entity_1.archived",
|
||||
" AND person_3.age = ($1 #>> '{}')::NUMERIC",
|
||||
@ -1787,15 +1826,15 @@
|
||||
" 'address', email_address_5.address",
|
||||
" )",
|
||||
" FROM agreego.entity entity_4",
|
||||
" JOIN agreego.email_address email_address_5 ON email_address_5.id = entity_4.id",
|
||||
" JOIN agreego.email_address email_address_5",
|
||||
" WHERE",
|
||||
" NOT entity_4.archived",
|
||||
" AND relationship_2.target_id = entity_4.id",
|
||||
" )",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_1",
|
||||
" JOIN agreego.relationship relationship_2 ON relationship_2.id = entity_1.id",
|
||||
" JOIN agreego.contact contact_3 ON contact_3.id = relationship_2.id",
|
||||
" JOIN agreego.relationship relationship_2",
|
||||
" JOIN agreego.contact contact_3",
|
||||
" WHERE",
|
||||
" NOT entity_1.archived",
|
||||
" AND relationship_2.target_type = 'email_address'",
|
||||
@ -1829,11 +1868,13 @@
|
||||
" 'name', organization_4.name,",
|
||||
" 'first_name', person_5.first_name,",
|
||||
" 'last_name', person_5.last_name,",
|
||||
" 'age', person_5.age",
|
||||
" 'age', person_5.age,",
|
||||
" 'rating', person_5.rating,",
|
||||
" 'tags', person_5.tags",
|
||||
" )",
|
||||
" FROM agreego.entity entity_3",
|
||||
" JOIN agreego.organization organization_4 ON organization_4.id = entity_3.id",
|
||||
" JOIN agreego.person person_5 ON person_5.id = organization_4.id",
|
||||
" JOIN agreego.organization organization_4",
|
||||
" JOIN agreego.person person_5",
|
||||
" WHERE",
|
||||
" NOT entity_3.archived",
|
||||
" AND order_2.customer_id = person_5.id",
|
||||
@ -1849,14 +1890,14 @@
|
||||
" 'price', order_line_7.price",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_6",
|
||||
" JOIN agreego.order_line order_line_7 ON order_line_7.id = entity_6.id",
|
||||
" JOIN agreego.order_line order_line_7",
|
||||
" WHERE",
|
||||
" NOT entity_6.archived",
|
||||
" AND order_line_7.order_id = order_2.id",
|
||||
" )",
|
||||
" )",
|
||||
" FROM agreego.entity entity_1",
|
||||
" JOIN agreego.order order_2 ON order_2.id = entity_1.id",
|
||||
" JOIN agreego.order order_2",
|
||||
" WHERE",
|
||||
" NOT entity_1.archived",
|
||||
"))))"
|
||||
@ -1881,7 +1922,7 @@
|
||||
" 'name', organization_2.name",
|
||||
" )",
|
||||
" FROM agreego.entity entity_1",
|
||||
" JOIN agreego.organization organization_2 ON organization_2.id = entity_1.id",
|
||||
" JOIN agreego.organization organization_2",
|
||||
" WHERE",
|
||||
" NOT entity_1.archived",
|
||||
"))))"
|
||||
@ -1910,8 +1951,8 @@
|
||||
" 'role', bot_5.role",
|
||||
" )",
|
||||
" FROM agreego.entity entity_3",
|
||||
" JOIN agreego.organization organization_4 ON organization_4.id = entity_3.id",
|
||||
" JOIN agreego.bot bot_5 ON bot_5.id = organization_4.id",
|
||||
" JOIN agreego.organization organization_4",
|
||||
" JOIN agreego.bot bot_5",
|
||||
" WHERE",
|
||||
" NOT entity_3.archived",
|
||||
" AND entity_3.id = entity_1.id",
|
||||
@ -1925,7 +1966,7 @@
|
||||
" 'name', organization_7.name",
|
||||
" )",
|
||||
" FROM agreego.entity entity_6",
|
||||
" JOIN agreego.organization organization_7 ON organization_7.id = entity_6.id",
|
||||
" JOIN agreego.organization organization_7",
|
||||
" WHERE",
|
||||
" NOT entity_6.archived",
|
||||
" AND entity_6.id = entity_1.id",
|
||||
@ -1939,11 +1980,13 @@
|
||||
" 'name', organization_9.name,",
|
||||
" 'first_name', person_10.first_name,",
|
||||
" 'last_name', person_10.last_name,",
|
||||
" 'age', person_10.age",
|
||||
" 'age', person_10.age,",
|
||||
" 'rating', person_10.rating,",
|
||||
" 'tags', person_10.tags",
|
||||
" )",
|
||||
" FROM agreego.entity entity_8",
|
||||
" JOIN agreego.organization organization_9 ON organization_9.id = entity_8.id",
|
||||
" JOIN agreego.person person_10 ON person_10.id = organization_9.id",
|
||||
" JOIN agreego.organization organization_9",
|
||||
" JOIN agreego.person person_10",
|
||||
" WHERE",
|
||||
" NOT entity_8.archived",
|
||||
" AND entity_8.id = entity_1.id",
|
||||
@ -1951,7 +1994,7 @@
|
||||
" ELSE NULL",
|
||||
" END), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_1",
|
||||
" JOIN agreego.organization organization_2 ON organization_2.id = entity_1.id",
|
||||
" JOIN agreego.organization organization_2",
|
||||
" WHERE",
|
||||
" NOT entity_1.archived",
|
||||
"))))"
|
||||
@ -1979,8 +2022,8 @@
|
||||
" 'token', bot_5.token",
|
||||
" )",
|
||||
" FROM agreego.entity entity_3",
|
||||
" JOIN agreego.organization organization_4 ON organization_4.id = entity_3.id",
|
||||
" JOIN agreego.bot bot_5 ON bot_5.id = organization_4.id",
|
||||
" JOIN agreego.organization organization_4",
|
||||
" JOIN agreego.bot bot_5",
|
||||
" WHERE",
|
||||
" NOT entity_3.archived",
|
||||
" AND entity_3.id = entity_1.id",
|
||||
@ -1993,11 +2036,13 @@
|
||||
" 'created_at', entity_6.created_at,",
|
||||
" 'name', organization_7.name,",
|
||||
" 'first_name', person_8.first_name,",
|
||||
" 'last_name', person_8.last_name",
|
||||
" 'last_name', person_8.last_name,",
|
||||
" 'rating', person_8.rating,",
|
||||
" 'tags', person_8.tags",
|
||||
" )",
|
||||
" FROM agreego.entity entity_6",
|
||||
" JOIN agreego.organization organization_7 ON organization_7.id = entity_6.id",
|
||||
" JOIN agreego.person person_8 ON person_8.id = organization_7.id",
|
||||
" JOIN agreego.organization organization_7",
|
||||
" JOIN agreego.person person_8",
|
||||
" WHERE",
|
||||
" NOT entity_6.archived",
|
||||
" AND entity_6.id = entity_1.id",
|
||||
@ -2005,7 +2050,7 @@
|
||||
" ELSE NULL",
|
||||
" END",
|
||||
" FROM agreego.entity entity_1",
|
||||
" JOIN agreego.organization organization_2 ON organization_2.id = entity_1.id",
|
||||
" JOIN agreego.organization organization_2",
|
||||
" WHERE",
|
||||
" NOT entity_1.archived",
|
||||
"))))"
|
||||
@ -2033,6 +2078,8 @@
|
||||
" 'first_name', person_5.first_name,",
|
||||
" 'last_name', person_5.last_name,",
|
||||
" 'age', person_5.age,",
|
||||
" 'rating', person_5.rating,",
|
||||
" 'tags', person_5.tags,",
|
||||
" 'phone_numbers', (",
|
||||
" SELECT COALESCE(jsonb_agg(jsonb_build_object(",
|
||||
" 'id', entity_6.id,",
|
||||
@ -2049,15 +2096,15 @@
|
||||
" 'number', phone_number_10.number",
|
||||
" )",
|
||||
" FROM agreego.entity entity_9",
|
||||
" JOIN agreego.phone_number phone_number_10 ON phone_number_10.id = entity_9.id",
|
||||
" JOIN agreego.phone_number phone_number_10",
|
||||
" WHERE",
|
||||
" NOT entity_9.archived",
|
||||
" AND relationship_7.target_id = entity_9.id",
|
||||
" )",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_6",
|
||||
" JOIN agreego.relationship relationship_7 ON relationship_7.id = entity_6.id",
|
||||
" JOIN agreego.contact contact_8 ON contact_8.id = relationship_7.id",
|
||||
" JOIN agreego.relationship relationship_7",
|
||||
" JOIN agreego.contact contact_8",
|
||||
" WHERE",
|
||||
" NOT entity_6.archived",
|
||||
" AND relationship_7.target_type = 'phone_number'",
|
||||
@ -2079,15 +2126,15 @@
|
||||
" 'address', email_address_15.address",
|
||||
" )",
|
||||
" FROM agreego.entity entity_14",
|
||||
" JOIN agreego.email_address email_address_15 ON email_address_15.id = entity_14.id",
|
||||
" JOIN agreego.email_address email_address_15",
|
||||
" WHERE",
|
||||
" NOT entity_14.archived",
|
||||
" AND relationship_12.target_id = entity_14.id",
|
||||
" )",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_11",
|
||||
" JOIN agreego.relationship relationship_12 ON relationship_12.id = entity_11.id",
|
||||
" JOIN agreego.contact contact_13 ON contact_13.id = relationship_12.id",
|
||||
" JOIN agreego.relationship relationship_12",
|
||||
" JOIN agreego.contact contact_13",
|
||||
" WHERE",
|
||||
" NOT entity_11.archived",
|
||||
" AND relationship_12.target_type = 'email_address'",
|
||||
@ -2109,15 +2156,15 @@
|
||||
" 'city', address_20.city",
|
||||
" )",
|
||||
" FROM agreego.entity entity_19",
|
||||
" JOIN agreego.address address_20 ON address_20.id = entity_19.id",
|
||||
" JOIN agreego.address address_20",
|
||||
" WHERE",
|
||||
" NOT entity_19.archived",
|
||||
" AND relationship_17.target_id = entity_19.id",
|
||||
" )",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_16",
|
||||
" JOIN agreego.relationship relationship_17 ON relationship_17.id = entity_16.id",
|
||||
" JOIN agreego.contact contact_18 ON contact_18.id = relationship_17.id",
|
||||
" JOIN agreego.relationship relationship_17",
|
||||
" JOIN agreego.contact contact_18",
|
||||
" WHERE",
|
||||
" NOT entity_16.archived",
|
||||
" AND relationship_17.target_type = 'address'",
|
||||
@ -2140,7 +2187,7 @@
|
||||
" 'number', phone_number_25.number",
|
||||
" )",
|
||||
" FROM agreego.entity entity_24",
|
||||
" JOIN agreego.phone_number phone_number_25 ON phone_number_25.id = entity_24.id",
|
||||
" JOIN agreego.phone_number phone_number_25",
|
||||
" WHERE",
|
||||
" NOT entity_24.archived",
|
||||
" AND relationship_22.target_id = entity_24.id",
|
||||
@ -2154,7 +2201,7 @@
|
||||
" 'address', email_address_27.address",
|
||||
" )",
|
||||
" FROM agreego.entity entity_26",
|
||||
" JOIN agreego.email_address email_address_27 ON email_address_27.id = entity_26.id",
|
||||
" JOIN agreego.email_address email_address_27",
|
||||
" WHERE",
|
||||
" NOT entity_26.archived",
|
||||
" AND relationship_22.target_id = entity_26.id",
|
||||
@ -2168,7 +2215,7 @@
|
||||
" 'city', address_29.city",
|
||||
" )",
|
||||
" FROM agreego.entity entity_28",
|
||||
" JOIN agreego.address address_29 ON address_29.id = entity_28.id",
|
||||
" JOIN agreego.address address_29",
|
||||
" WHERE",
|
||||
" NOT entity_28.archived",
|
||||
" AND relationship_22.target_id = entity_28.id",
|
||||
@ -2177,16 +2224,16 @@
|
||||
" END",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_21",
|
||||
" JOIN agreego.relationship relationship_22 ON relationship_22.id = entity_21.id",
|
||||
" JOIN agreego.contact contact_23 ON contact_23.id = relationship_22.id",
|
||||
" JOIN agreego.relationship relationship_22",
|
||||
" JOIN agreego.contact contact_23",
|
||||
" WHERE",
|
||||
" NOT entity_21.archived",
|
||||
" AND relationship_22.source_id = entity_3.id",
|
||||
" )",
|
||||
" )",
|
||||
" FROM agreego.entity entity_3",
|
||||
" JOIN agreego.organization organization_4 ON organization_4.id = entity_3.id",
|
||||
" JOIN agreego.person person_5 ON person_5.id = organization_4.id",
|
||||
" JOIN agreego.organization organization_4",
|
||||
" JOIN agreego.person person_5",
|
||||
" WHERE",
|
||||
" NOT entity_3.archived",
|
||||
" AND entity_3.id = entity_1.id",
|
||||
@ -2194,7 +2241,7 @@
|
||||
" ELSE NULL",
|
||||
" END",
|
||||
" FROM agreego.entity entity_1",
|
||||
" JOIN agreego.organization organization_2 ON organization_2.id = entity_1.id",
|
||||
" JOIN agreego.organization organization_2",
|
||||
" WHERE",
|
||||
" NOT entity_1.archived",
|
||||
"))))"
|
||||
@ -2227,18 +2274,20 @@
|
||||
" 'name', organization_4.name,",
|
||||
" 'first_name', person_5.first_name,",
|
||||
" 'last_name', person_5.last_name,",
|
||||
" 'age', person_5.age",
|
||||
" 'age', person_5.age,",
|
||||
" 'rating', person_5.rating,",
|
||||
" 'tags', person_5.tags",
|
||||
" )",
|
||||
" FROM agreego.entity entity_3",
|
||||
" JOIN agreego.organization organization_4 ON organization_4.id = entity_3.id",
|
||||
" JOIN agreego.person person_5 ON person_5.id = organization_4.id",
|
||||
" JOIN agreego.organization organization_4",
|
||||
" JOIN agreego.person person_5",
|
||||
" WHERE",
|
||||
" NOT entity_3.archived",
|
||||
" AND order_2.customer_id = person_5.id",
|
||||
" )",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_1",
|
||||
" JOIN agreego.order order_2 ON order_2.id = entity_1.id",
|
||||
" JOIN agreego.order order_2",
|
||||
" WHERE",
|
||||
" NOT entity_1.archived",
|
||||
"))))"
|
||||
@ -2273,7 +2322,7 @@
|
||||
" ELSE NULL",
|
||||
" END), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_1",
|
||||
" JOIN agreego.widget widget_2 ON widget_2.id = entity_1.id",
|
||||
" JOIN agreego.widget widget_2",
|
||||
" WHERE",
|
||||
" NOT entity_1.archived",
|
||||
"))))"
|
||||
@ -2306,7 +2355,7 @@
|
||||
" 'price', invoice_line_4.price",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_3",
|
||||
" JOIN agreego.invoice_line invoice_line_4 ON invoice_line_4.id = entity_3.id",
|
||||
" JOIN agreego.invoice_line invoice_line_4",
|
||||
" WHERE",
|
||||
" NOT entity_3.archived",
|
||||
" AND invoice_line_4.invoice_id = invoice_2.id",
|
||||
@ -2317,7 +2366,7 @@
|
||||
" 'metadata_nested_lines', invoice_2.metadata_nested_lines",
|
||||
" )",
|
||||
" FROM agreego.entity entity_1",
|
||||
" JOIN agreego.invoice invoice_2 ON invoice_2.id = entity_1.id",
|
||||
" JOIN agreego.invoice invoice_2",
|
||||
" WHERE",
|
||||
" NOT entity_1.archived",
|
||||
"))))"
|
||||
@ -2344,7 +2393,7 @@
|
||||
" 'card_number', account_2.card_number",
|
||||
" )",
|
||||
" FROM agreego.entity entity_1",
|
||||
" JOIN agreego.account account_2 ON account_2.id = entity_1.id",
|
||||
" JOIN agreego.account account_2",
|
||||
" WHERE",
|
||||
" NOT entity_1.archived",
|
||||
"))))"
|
||||
@ -2381,8 +2430,8 @@
|
||||
" 'role', bot_7.role",
|
||||
" )",
|
||||
" FROM agreego.entity entity_5",
|
||||
" JOIN agreego.organization organization_6 ON organization_6.id = entity_5.id",
|
||||
" JOIN agreego.bot bot_7 ON bot_7.id = organization_6.id",
|
||||
" JOIN agreego.organization organization_6",
|
||||
" JOIN agreego.bot bot_7",
|
||||
" WHERE",
|
||||
" NOT entity_5.archived",
|
||||
" AND entity_5.id = entity_3.id",
|
||||
@ -2396,7 +2445,7 @@
|
||||
" 'name', organization_9.name",
|
||||
" )",
|
||||
" FROM agreego.entity entity_8",
|
||||
" JOIN agreego.organization organization_9 ON organization_9.id = entity_8.id",
|
||||
" JOIN agreego.organization organization_9",
|
||||
" WHERE",
|
||||
" NOT entity_8.archived",
|
||||
" AND entity_8.id = entity_3.id",
|
||||
@ -2410,11 +2459,13 @@
|
||||
" 'name', organization_11.name,",
|
||||
" 'first_name', person_12.first_name,",
|
||||
" 'last_name', person_12.last_name,",
|
||||
" 'age', person_12.age",
|
||||
" 'age', person_12.age,",
|
||||
" 'rating', person_12.rating,",
|
||||
" 'tags', person_12.tags",
|
||||
" )",
|
||||
" FROM agreego.entity entity_10",
|
||||
" JOIN agreego.organization organization_11 ON organization_11.id = entity_10.id",
|
||||
" JOIN agreego.person person_12 ON person_12.id = organization_11.id",
|
||||
" JOIN agreego.organization organization_11",
|
||||
" JOIN agreego.person person_12",
|
||||
" WHERE",
|
||||
" NOT entity_10.archived",
|
||||
" AND entity_10.id = entity_3.id",
|
||||
@ -2422,14 +2473,14 @@
|
||||
" ELSE NULL",
|
||||
" END",
|
||||
" FROM agreego.entity entity_3",
|
||||
" JOIN agreego.organization organization_4 ON organization_4.id = entity_3.id",
|
||||
" JOIN agreego.organization organization_4",
|
||||
" WHERE",
|
||||
" NOT entity_3.archived",
|
||||
" AND order_2.counterparty_id = entity_3.id",
|
||||
" )",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_1",
|
||||
" JOIN agreego.order order_2 ON order_2.id = entity_1.id",
|
||||
" JOIN agreego.order order_2",
|
||||
" WHERE",
|
||||
" NOT entity_1.archived",
|
||||
" AND order_2.counterparty_type IN ('bot', 'organization', 'person')",
|
||||
@ -2437,6 +2488,202 @@
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Person filters: float8 comparison and jsonb array containment",
|
||||
"action": "query",
|
||||
"schema_id": "full.person",
|
||||
"filter": {
|
||||
"rating": {
|
||||
"$gte": 4.0
|
||||
},
|
||||
"tags": {
|
||||
"$eq": "landscaping",
|
||||
"$of": [
|
||||
"plumbing",
|
||||
"electrical"
|
||||
]
|
||||
}
|
||||
},
|
||||
"expect": {
|
||||
"success": true,
|
||||
"sql": [
|
||||
[
|
||||
"((SELECT jsonb_strip_nulls((",
|
||||
" SELECT 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,",
|
||||
" 'phone_numbers', (",
|
||||
" SELECT COALESCE(jsonb_agg(jsonb_build_object(",
|
||||
" 'id', entity_4.id,",
|
||||
" 'type', entity_4.type,",
|
||||
" 'archived', entity_4.archived,",
|
||||
" 'created_at', entity_4.created_at,",
|
||||
" 'is_primary', contact_6.is_primary,",
|
||||
" 'target', (",
|
||||
" SELECT jsonb_build_object(",
|
||||
" 'id', entity_7.id,",
|
||||
" 'type', entity_7.type,",
|
||||
" 'archived', entity_7.archived,",
|
||||
" 'created_at', entity_7.created_at,",
|
||||
" 'number', phone_number_8.number",
|
||||
" )",
|
||||
" FROM agreego.entity entity_7",
|
||||
" JOIN agreego.phone_number phone_number_8",
|
||||
" WHERE",
|
||||
" NOT entity_7.archived",
|
||||
" AND relationship_5.target_id = entity_7.id",
|
||||
" )",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_4",
|
||||
" JOIN agreego.relationship relationship_5",
|
||||
" JOIN agreego.contact contact_6",
|
||||
" WHERE",
|
||||
" NOT entity_4.archived",
|
||||
" AND relationship_5.target_type = 'phone_number'",
|
||||
" AND relationship_5.source_id = entity_1.id",
|
||||
" ),",
|
||||
" 'email_addresses', (",
|
||||
" SELECT COALESCE(jsonb_agg(jsonb_build_object(",
|
||||
" 'id', entity_9.id,",
|
||||
" 'type', entity_9.type,",
|
||||
" 'archived', entity_9.archived,",
|
||||
" 'created_at', entity_9.created_at,",
|
||||
" 'is_primary', contact_11.is_primary,",
|
||||
" 'target', (",
|
||||
" SELECT jsonb_build_object(",
|
||||
" 'id', entity_12.id,",
|
||||
" 'type', entity_12.type,",
|
||||
" 'archived', entity_12.archived,",
|
||||
" 'created_at', entity_12.created_at,",
|
||||
" 'address', email_address_13.address",
|
||||
" )",
|
||||
" FROM agreego.entity entity_12",
|
||||
" JOIN agreego.email_address email_address_13",
|
||||
" WHERE",
|
||||
" NOT entity_12.archived",
|
||||
" AND relationship_10.target_id = entity_12.id",
|
||||
" )",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_9",
|
||||
" JOIN agreego.relationship relationship_10",
|
||||
" JOIN agreego.contact contact_11",
|
||||
" WHERE",
|
||||
" NOT entity_9.archived",
|
||||
" AND relationship_10.target_type = 'email_address'",
|
||||
" AND relationship_10.source_id = entity_1.id",
|
||||
" ),",
|
||||
" 'addresses', (",
|
||||
" SELECT COALESCE(jsonb_agg(jsonb_build_object(",
|
||||
" 'id', entity_14.id,",
|
||||
" 'type', entity_14.type,",
|
||||
" 'archived', entity_14.archived,",
|
||||
" 'created_at', entity_14.created_at,",
|
||||
" 'is_primary', contact_16.is_primary,",
|
||||
" 'target', (",
|
||||
" SELECT jsonb_build_object(",
|
||||
" 'id', entity_17.id,",
|
||||
" 'type', entity_17.type,",
|
||||
" 'archived', entity_17.archived,",
|
||||
" 'created_at', entity_17.created_at,",
|
||||
" 'city', address_18.city",
|
||||
" )",
|
||||
" FROM agreego.entity entity_17",
|
||||
" JOIN agreego.address address_18",
|
||||
" WHERE",
|
||||
" NOT entity_17.archived",
|
||||
" AND relationship_15.target_id = entity_17.id",
|
||||
" )",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_14",
|
||||
" JOIN agreego.relationship relationship_15",
|
||||
" JOIN agreego.contact contact_16",
|
||||
" WHERE",
|
||||
" NOT entity_14.archived",
|
||||
" AND relationship_15.target_type = 'address'",
|
||||
" AND relationship_15.source_id = entity_1.id",
|
||||
" ),",
|
||||
" 'contacts', (",
|
||||
" SELECT COALESCE(jsonb_agg(jsonb_build_object(",
|
||||
" 'id', entity_19.id,",
|
||||
" 'type', entity_19.type,",
|
||||
" 'archived', entity_19.archived,",
|
||||
" 'created_at', entity_19.created_at,",
|
||||
" 'is_primary', contact_21.is_primary,",
|
||||
" 'target', CASE",
|
||||
" WHEN relationship_20.target_type = 'phone_number' THEN ((",
|
||||
" SELECT jsonb_build_object(",
|
||||
" 'id', entity_22.id,",
|
||||
" 'type', entity_22.type,",
|
||||
" 'archived', entity_22.archived,",
|
||||
" 'created_at', entity_22.created_at,",
|
||||
" 'number', phone_number_23.number",
|
||||
" )",
|
||||
" FROM agreego.entity entity_22",
|
||||
" JOIN agreego.phone_number phone_number_23",
|
||||
" WHERE",
|
||||
" NOT entity_22.archived",
|
||||
" AND relationship_20.target_id = entity_22.id",
|
||||
" ))",
|
||||
" WHEN relationship_20.target_type = 'email_address' THEN ((",
|
||||
" SELECT jsonb_build_object(",
|
||||
" 'id', entity_24.id,",
|
||||
" 'type', entity_24.type,",
|
||||
" 'archived', entity_24.archived,",
|
||||
" 'created_at', entity_24.created_at,",
|
||||
" 'address', email_address_25.address",
|
||||
" )",
|
||||
" FROM agreego.entity entity_24",
|
||||
" JOIN agreego.email_address email_address_25",
|
||||
" WHERE",
|
||||
" NOT entity_24.archived",
|
||||
" AND relationship_20.target_id = entity_24.id",
|
||||
" ))",
|
||||
" WHEN relationship_20.target_type = 'address' THEN ((",
|
||||
" SELECT jsonb_build_object(",
|
||||
" 'id', entity_26.id,",
|
||||
" 'type', entity_26.type,",
|
||||
" 'archived', entity_26.archived,",
|
||||
" 'created_at', entity_26.created_at,",
|
||||
" 'city', address_27.city",
|
||||
" )",
|
||||
" FROM agreego.entity entity_26",
|
||||
" JOIN agreego.address address_27",
|
||||
" WHERE",
|
||||
" NOT entity_26.archived",
|
||||
" AND relationship_20.target_id = entity_26.id",
|
||||
" ))",
|
||||
" ELSE NULL",
|
||||
" END",
|
||||
" )), '[]'::jsonb)",
|
||||
" FROM agreego.entity entity_19",
|
||||
" JOIN agreego.relationship relationship_20",
|
||||
" JOIN agreego.contact contact_21",
|
||||
" WHERE",
|
||||
" NOT entity_19.archived",
|
||||
" AND relationship_20.source_id = entity_1.id",
|
||||
" )",
|
||||
" )",
|
||||
" FROM agreego.entity entity_1",
|
||||
" JOIN agreego.organization organization_2",
|
||||
" 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()",
|
||||
" ))))"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -139,8 +139,8 @@
|
||||
{
|
||||
"code": "MAX_LENGTH_VIOLATED",
|
||||
"values": {
|
||||
"count": "26",
|
||||
"limit": "5"
|
||||
"limit": "5",
|
||||
"count": "26"
|
||||
},
|
||||
"details": {
|
||||
"path": "email",
|
||||
|
||||
2
flows
2
flows
Submodule flows updated: 0d9bd8644e...89748a246e
@ -26,14 +26,10 @@ impl Schema {
|
||||
if let Some(items) = &child.obj.items {
|
||||
if !items.is_proxy() {
|
||||
structural_filter = items.compile_filter(_db, "", _errors);
|
||||
} else if let Some(target) = Self::value_type_target(items, _db) {
|
||||
structural_filter = target.compile_filter(_db, "", _errors);
|
||||
}
|
||||
}
|
||||
} else if !child.is_proxy() {
|
||||
structural_filter = child.compile_filter(_db, "", _errors);
|
||||
} else if let Some(target) = Self::value_type_target(child, _db) {
|
||||
structural_filter = target.compile_filter(_db, "", _errors);
|
||||
}
|
||||
|
||||
if let Some(mut inline_schema) = structural_filter {
|
||||
@ -121,37 +117,6 @@ impl Schema {
|
||||
None
|
||||
}
|
||||
|
||||
/// Resolves a pure type-pointer schema to a named non-table value type's own schema —
|
||||
/// a reusable, schema-only object (e.g. an operating-hours config). Naming a value type
|
||||
/// is a reuse choice, not a semantics choice: it filters structurally, exactly like an
|
||||
/// inline object. Table-backed boundaries keep the lazy {type}.filter reference instead.
|
||||
fn value_type_target<'a>(schema: &Arc<Schema>, db: &'a Database) -> Option<&'a Arc<Schema>> {
|
||||
let t = match &schema.obj.type_ {
|
||||
Some(SchemaTypeOrArray::Single(t)) => Some(t.as_str()),
|
||||
Some(SchemaTypeOrArray::Multiple(types)) => {
|
||||
types.iter().find(|t| *t != "null").map(|s| s.as_str())
|
||||
}
|
||||
None => None,
|
||||
}?;
|
||||
if matches!(
|
||||
t,
|
||||
"string" | "integer" | "number" | "boolean" | "object" | "array" | "null"
|
||||
) {
|
||||
return None;
|
||||
}
|
||||
if t.ends_with(".condition") || t.ends_with(".filter") {
|
||||
return None;
|
||||
}
|
||||
if db.enums.contains_key(t) {
|
||||
return None;
|
||||
}
|
||||
let base = t.split('.').next_back().unwrap_or(t);
|
||||
if db.types.contains_key(base) {
|
||||
return None;
|
||||
}
|
||||
db.schemas.get(t)
|
||||
}
|
||||
|
||||
fn resolve_filter_type(schema: &Arc<Schema>, db: &Database) -> Option<Vec<String>> {
|
||||
if let Some(type_) = &schema.obj.type_ {
|
||||
match type_ {
|
||||
@ -200,10 +165,10 @@ impl Schema {
|
||||
} else if db.enums.contains_key(custom) {
|
||||
Some(vec![format!("{}.condition", custom)])
|
||||
} else {
|
||||
// A Relational cross-boundary gets a reference to the target's dynamically built
|
||||
// .filter — but only a table-backed boundary has one. A named non-table value type
|
||||
// compiles structurally upstream (value_type_target); reaching here means it had
|
||||
// no compilable structure — omit it rather than emit a dangling .filter reference.
|
||||
// Only a Table-Backed boundary has a synthesized Composed Filter to proxy to.
|
||||
// A Field-Backed JSONB Bubble has none — omit it like an inline object rather
|
||||
// than emit a dangling proxy reference, which breaks eager consumers of the
|
||||
// exported registry (downstream code generators).
|
||||
let base = custom.split('.').next_back().unwrap_or(custom);
|
||||
if db.types.contains_key(base) {
|
||||
Some(vec![format!("{}.filter", custom)])
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
use crate::database::action::Action;
|
||||
use indexmap::IndexMap;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::Value;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
||||
#[serde(default)]
|
||||
@ -13,6 +14,11 @@ pub struct Page {
|
||||
pub sidebar: Option<Sidebar>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub actions: Option<IndexMap<String, Action>>,
|
||||
/// The personal-scope filter template ("one surface, two scopes"): the
|
||||
/// "mine" predicate the page merges into its filter when the app is in
|
||||
/// personal scope, e.g. {"reserved_by": "$me"}. Opaque to the engine.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub personal: Option<Value>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
||||
|
||||
@ -744,9 +744,15 @@ impl Merger {
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
let where_clause = format!("WHERE {}", where_parts.join(" OR "));
|
||||
|
||||
let final_sql = format!("{} {}", fetch_sql_template, where_clause);
|
||||
let final_sql = if where_parts.len() == 1 {
|
||||
format!("{} WHERE {}", fetch_sql_template, where_parts[0])
|
||||
} else {
|
||||
where_parts
|
||||
.iter()
|
||||
.map(|p| format!("{} WHERE {}", fetch_sql_template, p))
|
||||
.collect::<Vec<_>>()
|
||||
.join(" UNION ")
|
||||
};
|
||||
|
||||
let fetched = match self.db.query(&final_sql, None) {
|
||||
Ok(Value::Array(table)) => {
|
||||
|
||||
@ -549,7 +549,7 @@ impl<'a> Compiler<'a> {
|
||||
where_clauses.push(format!("NOT {}.archived", entity_alias));
|
||||
}
|
||||
|
||||
self.compile_filter_conditions(r#type, type_aliases, &node, &base_alias, &mut where_clauses);
|
||||
self.compile_filter_conditions(r#type, type_aliases, &node, &base_alias, &mut where_clauses)?;
|
||||
self.compile_polymorphic_bounds(r#type, type_aliases, &node, &mut where_clauses);
|
||||
|
||||
let start_len = where_clauses.len();
|
||||
@ -689,6 +689,11 @@ impl<'a> Compiler<'a> {
|
||||
|| pg_type.contains("int")
|
||||
|| pg_type == "real"
|
||||
|| pg_type == "double precision"
|
||||
// pg catalog typnames for real / double precision — the SQL
|
||||
// names above never appear in field_types (they come from
|
||||
// pg_type.typname), so these are what actually arrives
|
||||
|| pg_type == "float4"
|
||||
|| pg_type == "float8"
|
||||
{
|
||||
cast = "::numeric";
|
||||
} else if pg_type == "text" || pg_type.contains("char") {
|
||||
@ -715,7 +720,7 @@ impl<'a> Compiler<'a> {
|
||||
node: &Node,
|
||||
base_alias: &str,
|
||||
where_clauses: &mut Vec<String>,
|
||||
) {
|
||||
) -> Result<(), String> {
|
||||
for (i, filter_key) in self.filter_keys.iter().enumerate() {
|
||||
let mut parts = filter_key.split(':');
|
||||
let full_field_path = parts.next().unwrap_or(filter_key);
|
||||
@ -745,6 +750,80 @@ impl<'a> Compiler<'a> {
|
||||
let param_index = i + 1;
|
||||
let p_val = format!("${}#>>'{{}}'", param_index);
|
||||
|
||||
// jsonb columns never type-check against the text parameter, and for
|
||||
// array-valued properties (tag lists) the meaning of a condition is
|
||||
// CONTAINMENT, not equality. Compile them explicitly; reject the rest
|
||||
// loudly at compile time instead of failing at execution.
|
||||
let is_jsonb = r#type
|
||||
.field_types
|
||||
.as_ref()
|
||||
.and_then(|v| v.as_object())
|
||||
.and_then(|ft| ft.get(field_name))
|
||||
.and_then(|v| v.as_str())
|
||||
== Some("jsonb");
|
||||
if is_jsonb {
|
||||
let is_array_prop = node
|
||||
.schema
|
||||
.obj
|
||||
.properties
|
||||
.as_ref()
|
||||
.and_then(|p| p.get(field_name))
|
||||
.map(|ps| {
|
||||
matches!(
|
||||
&ps.obj.type_,
|
||||
Some(crate::database::object::SchemaTypeOrArray::Single(t)) if t == "array"
|
||||
)
|
||||
})
|
||||
.unwrap_or(false);
|
||||
|
||||
if is_array_prop {
|
||||
match op {
|
||||
// "the array contains this value"
|
||||
"$eq" => where_clauses.push(format!(
|
||||
"{}.{} ? ({})",
|
||||
filter_alias, field_name, p_val
|
||||
)),
|
||||
"$ne" => where_clauses.push(format!(
|
||||
"NOT ({}.{} ? ({}))",
|
||||
filter_alias, field_name, p_val
|
||||
)),
|
||||
// "the array contains ANY of these values"
|
||||
"$of" => where_clauses.push(format!(
|
||||
"{}.{} ?| ARRAY(SELECT jsonb_array_elements_text(({})::jsonb))",
|
||||
filter_alias, field_name, p_val
|
||||
)),
|
||||
"$nof" => where_clauses.push(format!(
|
||||
"NOT ({}.{} ?| ARRAY(SELECT jsonb_array_elements_text(({})::jsonb)))",
|
||||
filter_alias, field_name, p_val
|
||||
)),
|
||||
other => {
|
||||
return Err(format!(
|
||||
"operator {} is not supported on array property '{}' (jsonb containment supports $eq/$ne/$of/$nof)",
|
||||
other, field_name
|
||||
))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
match op {
|
||||
"$eq" => where_clauses.push(format!(
|
||||
"{}.{} = ({})::jsonb",
|
||||
filter_alias, field_name, p_val
|
||||
)),
|
||||
"$ne" => where_clauses.push(format!(
|
||||
"{}.{} != ({})::jsonb",
|
||||
filter_alias, field_name, p_val
|
||||
)),
|
||||
other => {
|
||||
return Err(format!(
|
||||
"operator {} is not supported on jsonb property '{}' (only $eq/$ne)",
|
||||
other, field_name
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if op == "$of" || op == "$nof" {
|
||||
let sql_op = if op == "$of" { "IN" } else { "NOT IN" };
|
||||
let subquery = format!(
|
||||
@ -796,6 +875,7 @@ impl<'a> Compiler<'a> {
|
||||
));
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn compile_relation_conditions(
|
||||
|
||||
@ -1301,6 +1301,12 @@ fn test_queryer_0_15() {
|
||||
crate::tests::runner::run_test_case(&path, 0, 15).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_queryer_0_16() {
|
||||
let path = format!("{}/fixtures/queryer.json", env!("CARGO_MANIFEST_DIR"));
|
||||
crate::tests::runner::run_test_case(&path, 0, 16).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_polymorphism_0_0() {
|
||||
let path = format!("{}/fixtures/polymorphism.json", env!("CARGO_MANIFEST_DIR"));
|
||||
|
||||
@ -179,14 +179,35 @@ impl SqlFormatter {
|
||||
}
|
||||
|
||||
fn format_query(&mut self, query: &Query) {
|
||||
match &*query.body {
|
||||
self.format_set_expr(&query.body);
|
||||
}
|
||||
|
||||
fn format_set_expr(&mut self, set_expr: &SetExpr) {
|
||||
match set_expr {
|
||||
SetExpr::Select(select) => self.format_select(select),
|
||||
SetExpr::Query(inner_query) => {
|
||||
self.push_str("(");
|
||||
self.format_query(inner_query);
|
||||
self.push_str(")");
|
||||
}
|
||||
_ => self.push_str(&query.to_string()),
|
||||
SetExpr::SetOperation { op, left, right, set_quantifier } => {
|
||||
self.format_set_expr(left);
|
||||
let op_str = match op {
|
||||
sqlparser::ast::SetOperator::Union => "UNION",
|
||||
sqlparser::ast::SetOperator::Intersect => "INTERSECT",
|
||||
sqlparser::ast::SetOperator::Except => "EXCEPT",
|
||||
_ => "UNION",
|
||||
};
|
||||
let quant_str = match set_quantifier {
|
||||
sqlparser::ast::SetQuantifier::All => " ALL",
|
||||
sqlparser::ast::SetQuantifier::Distinct => " DISTINCT",
|
||||
sqlparser::ast::SetQuantifier::None => "",
|
||||
_ => "",
|
||||
};
|
||||
self.push_line(&format!("{}{} ", op_str, quant_str));
|
||||
self.format_set_expr(right);
|
||||
}
|
||||
_ => self.push_str(&set_expr.to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
@ -236,20 +257,22 @@ impl SqlFormatter {
|
||||
}
|
||||
|
||||
fn format_join(&mut self, join: &Join) {
|
||||
let op = match &join.join_operator {
|
||||
let op_str = match &join.join_operator {
|
||||
JoinOperator::Inner(_) => "JOIN",
|
||||
JoinOperator::LeftOuter(_) => "LEFT JOIN",
|
||||
JoinOperator::Left(_) => "LEFT JOIN",
|
||||
JoinOperator::Right(_) => "RIGHT JOIN",
|
||||
_ => "JOIN",
|
||||
};
|
||||
self.push_str(&format!("{} {} ON ", op, join.relation));
|
||||
self.push_str(&format!("{} {}", op_str, join.relation));
|
||||
|
||||
match &join.join_operator {
|
||||
JoinOperator::Inner(JoinConstraint::On(expr)) => self.format_expr(expr),
|
||||
JoinOperator::LeftOuter(JoinConstraint::On(expr)) => self.format_expr(expr),
|
||||
JoinOperator::Join(JoinConstraint::On(expr)) => self.format_expr(expr),
|
||||
_ => {
|
||||
println!("FALLBACK JOIN OP: {:?}", join.join_operator);
|
||||
JoinOperator::Inner(JoinConstraint::On(expr))
|
||||
| JoinOperator::Left(JoinConstraint::On(expr))
|
||||
| JoinOperator::Right(JoinConstraint::On(expr)) => {
|
||||
self.push_str(" ON ");
|
||||
self.format_expr(expr);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user