checkpoint
This commit is contained in:
@ -25,11 +25,20 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "get_person",
|
||||
"name": "get_light_organizations",
|
||||
"schemas": [
|
||||
{
|
||||
"$id": "get_person.response",
|
||||
"$family": "person"
|
||||
"$id": "get_light_organizations.response",
|
||||
"$family": "light.organization"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "get_full_organizations",
|
||||
"schemas": [
|
||||
{
|
||||
"$id": "get_full_organizations.response",
|
||||
"$family": "full.organization"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -44,6 +53,18 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "get_widgets",
|
||||
"schemas": [
|
||||
{
|
||||
"$id": "get_widgets.response",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$family": "widget"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"enums": [],
|
||||
@ -260,7 +281,9 @@
|
||||
"type",
|
||||
"name",
|
||||
"archived",
|
||||
"created_at"
|
||||
"created_at",
|
||||
"token",
|
||||
"role"
|
||||
],
|
||||
"grouped_fields": {
|
||||
"entity": [
|
||||
@ -273,7 +296,8 @@
|
||||
"name"
|
||||
],
|
||||
"bot": [
|
||||
"token"
|
||||
"token",
|
||||
"role"
|
||||
]
|
||||
},
|
||||
"field_types": {
|
||||
@ -282,12 +306,25 @@
|
||||
"archived": "boolean",
|
||||
"name": "text",
|
||||
"token": "text",
|
||||
"role": "text",
|
||||
"created_at": "timestamptz"
|
||||
},
|
||||
"schemas": [
|
||||
{
|
||||
"$id": "bot",
|
||||
"type": "organization",
|
||||
"properties": {
|
||||
"token": {
|
||||
"type": "string"
|
||||
},
|
||||
"role": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"$id": "light.bot",
|
||||
"type": "organization",
|
||||
"properties": {
|
||||
"token": {
|
||||
"type": "string"
|
||||
@ -360,8 +397,15 @@
|
||||
},
|
||||
{
|
||||
"$id": "light.person",
|
||||
"type": "person",
|
||||
"properties": {}
|
||||
"type": "organization",
|
||||
"properties": {
|
||||
"first_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"last_name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"$id": "full.person",
|
||||
@ -850,6 +894,46 @@
|
||||
"variations": [
|
||||
"order_line"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "widget",
|
||||
"hierarchy": ["widget", "entity"],
|
||||
"fields": ["id", "type", "kind", "archived", "created_at"],
|
||||
"grouped_fields": {
|
||||
"entity": ["id", "type", "archived", "created_at"],
|
||||
"widget": ["kind"]
|
||||
},
|
||||
"field_types": {
|
||||
"id": "uuid",
|
||||
"type": "text",
|
||||
"kind": "text",
|
||||
"archived": "boolean",
|
||||
"created_at": "timestamptz"
|
||||
},
|
||||
"variations": ["widget"],
|
||||
"schemas": [
|
||||
{
|
||||
"$id": "widget",
|
||||
"type": "entity",
|
||||
"properties": {
|
||||
"kind": { "type": "string" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"$id": "stock.widget",
|
||||
"type": "widget",
|
||||
"properties": {
|
||||
"kind": { "const": "stock" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"$id": "tasks.widget",
|
||||
"type": "widget",
|
||||
"properties": {
|
||||
"kind": { "const": "tasks" }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -1004,17 +1088,17 @@
|
||||
" 'target', CASE",
|
||||
" WHEN entity_11.target_type = 'address' THEN",
|
||||
" ((SELECT jsonb_build_object(",
|
||||
" 'archived', entity_17.archived,",
|
||||
" 'city', address_16.city,",
|
||||
" 'created_at', entity_17.created_at,",
|
||||
" 'id', entity_17.id,",
|
||||
" 'type', entity_17.type",
|
||||
" 'archived', entity_13.archived,",
|
||||
" 'city', address_12.city,",
|
||||
" 'created_at', entity_13.created_at,",
|
||||
" 'id', entity_13.id,",
|
||||
" 'type', entity_13.type",
|
||||
" )",
|
||||
" FROM agreego.address address_16",
|
||||
" JOIN agreego.entity entity_17 ON entity_17.id = address_16.id",
|
||||
" FROM agreego.address address_12",
|
||||
" JOIN agreego.entity entity_13 ON entity_13.id = address_12.id",
|
||||
" WHERE",
|
||||
" NOT entity_17.archived",
|
||||
" AND relationship_10.target_id = entity_17.id))",
|
||||
" NOT entity_13.archived",
|
||||
" AND relationship_10.target_id = entity_13.id))",
|
||||
" WHEN entity_11.target_type = 'email_address' THEN",
|
||||
" ((SELECT jsonb_build_object(",
|
||||
" 'address', email_address_14.address,",
|
||||
@ -1030,17 +1114,17 @@
|
||||
" AND relationship_10.target_id = entity_15.id))",
|
||||
" WHEN entity_11.target_type = 'phone_number' THEN",
|
||||
" ((SELECT jsonb_build_object(",
|
||||
" 'archived', entity_13.archived,",
|
||||
" 'created_at', entity_13.created_at,",
|
||||
" 'id', entity_13.id,",
|
||||
" 'number', phone_number_12.number,",
|
||||
" 'type', entity_13.type",
|
||||
" 'archived', entity_17.archived,",
|
||||
" 'created_at', entity_17.created_at,",
|
||||
" 'id', entity_17.id,",
|
||||
" 'number', phone_number_16.number,",
|
||||
" 'type', entity_17.type",
|
||||
" )",
|
||||
" FROM agreego.phone_number phone_number_12",
|
||||
" JOIN agreego.entity entity_13 ON entity_13.id = phone_number_12.id",
|
||||
" FROM agreego.phone_number phone_number_16",
|
||||
" JOIN agreego.entity entity_17 ON entity_17.id = phone_number_16.id",
|
||||
" WHERE",
|
||||
" NOT entity_13.archived",
|
||||
" AND relationship_10.target_id = entity_13.id))",
|
||||
" NOT entity_17.archived",
|
||||
" AND relationship_10.target_id = entity_17.id))",
|
||||
" ELSE NULL END,",
|
||||
" 'type', entity_11.type",
|
||||
" )), '[]'::jsonb)",
|
||||
@ -1240,17 +1324,17 @@
|
||||
" 'target', CASE",
|
||||
" WHEN entity_11.target_type = 'address' THEN",
|
||||
" ((SELECT jsonb_build_object(",
|
||||
" 'archived', entity_17.archived,",
|
||||
" 'city', address_16.city,",
|
||||
" 'created_at', entity_17.created_at,",
|
||||
" 'id', entity_17.id,",
|
||||
" 'type', entity_17.type",
|
||||
" 'archived', entity_13.archived,",
|
||||
" 'city', address_12.city,",
|
||||
" 'created_at', entity_13.created_at,",
|
||||
" 'id', entity_13.id,",
|
||||
" 'type', entity_13.type",
|
||||
" )",
|
||||
" FROM agreego.address address_16",
|
||||
" JOIN agreego.entity entity_17 ON entity_17.id = address_16.id",
|
||||
" FROM agreego.address address_12",
|
||||
" JOIN agreego.entity entity_13 ON entity_13.id = address_12.id",
|
||||
" WHERE",
|
||||
" NOT entity_17.archived",
|
||||
" AND relationship_10.target_id = entity_17.id))",
|
||||
" NOT entity_13.archived",
|
||||
" AND relationship_10.target_id = entity_13.id))",
|
||||
" WHEN entity_11.target_type = 'email_address' THEN",
|
||||
" ((SELECT jsonb_build_object(",
|
||||
" 'address', email_address_14.address,",
|
||||
@ -1266,17 +1350,17 @@
|
||||
" AND relationship_10.target_id = entity_15.id))",
|
||||
" WHEN entity_11.target_type = 'phone_number' THEN",
|
||||
" ((SELECT jsonb_build_object(",
|
||||
" 'archived', entity_13.archived,",
|
||||
" 'created_at', entity_13.created_at,",
|
||||
" 'id', entity_13.id,",
|
||||
" 'number', phone_number_12.number,",
|
||||
" 'type', entity_13.type",
|
||||
" 'archived', entity_17.archived,",
|
||||
" 'created_at', entity_17.created_at,",
|
||||
" 'id', entity_17.id,",
|
||||
" 'number', phone_number_16.number,",
|
||||
" 'type', entity_17.type",
|
||||
" )",
|
||||
" FROM agreego.phone_number phone_number_12",
|
||||
" JOIN agreego.entity entity_13 ON entity_13.id = phone_number_12.id",
|
||||
" FROM agreego.phone_number phone_number_16",
|
||||
" JOIN agreego.entity entity_17 ON entity_17.id = phone_number_16.id",
|
||||
" WHERE",
|
||||
" NOT entity_13.archived",
|
||||
" AND relationship_10.target_id = entity_13.id))",
|
||||
" NOT entity_17.archived",
|
||||
" AND relationship_10.target_id = entity_17.id))",
|
||||
" ELSE NULL END,",
|
||||
" 'type', entity_11.type",
|
||||
" )), '[]'::jsonb)",
|
||||
@ -1565,27 +1649,27 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Person select via a punc response with family",
|
||||
"description": "Light organizations select via a punc response with family",
|
||||
"action": "query",
|
||||
"schema_id": "get_person.response",
|
||||
"schema_id": "get_light_organizations.response",
|
||||
"expect": {
|
||||
"success": true,
|
||||
"sql": [
|
||||
[
|
||||
"(SELECT jsonb_strip_nulls((SELECT jsonb_build_object(",
|
||||
" 'age', person_1.age,",
|
||||
" 'archived', entity_3.archived,",
|
||||
" 'created_at', entity_3.created_at,",
|
||||
" 'first_name', person_1.first_name,",
|
||||
" 'id', entity_3.id,",
|
||||
" 'last_name', person_1.last_name,",
|
||||
" 'name', organization_2.name,",
|
||||
" 'type', entity_3.type",
|
||||
")",
|
||||
"FROM agreego.person person_1",
|
||||
"JOIN agreego.organization organization_2 ON organization_2.id = person_1.id",
|
||||
"JOIN agreego.entity entity_3 ON entity_3.id = organization_2.id",
|
||||
"WHERE NOT entity_3.archived)))"
|
||||
"FIX ME"
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Full organizations select via a punc response with family",
|
||||
"action": "query",
|
||||
"schema_id": "get_full_organizations.response",
|
||||
"expect": {
|
||||
"success": true,
|
||||
"sql": [
|
||||
[
|
||||
"FIX ME"
|
||||
]
|
||||
]
|
||||
}
|
||||
@ -1629,6 +1713,19 @@
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Widgets select via a punc response with family (STI)",
|
||||
"action": "query",
|
||||
"schema_id": "get_widgets.response",
|
||||
"expect": {
|
||||
"success": true,
|
||||
"sql": [
|
||||
[
|
||||
"FIX ME"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user