subschema id queryer test added
This commit is contained in:
@ -1408,6 +1408,44 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"description": "Person ad-hoc email addresses select",
|
||||||
|
"action": "query",
|
||||||
|
"schema_id": "full.person/email_addresses",
|
||||||
|
"expect": {
|
||||||
|
"success": true,
|
||||||
|
"sql": [
|
||||||
|
[
|
||||||
|
"(SELECT jsonb_build_object(",
|
||||||
|
" 'archived', entity_3.archived,",
|
||||||
|
" 'created_at', entity_3.created_at,",
|
||||||
|
" 'id', entity_3.id,",
|
||||||
|
" 'is_primary', contact_1.is_primary,",
|
||||||
|
" 'name', entity_3.name,",
|
||||||
|
" 'target',",
|
||||||
|
" (SELECT jsonb_build_object(",
|
||||||
|
" 'address', email_address_4.address,",
|
||||||
|
" 'archived', entity_5.archived,",
|
||||||
|
" 'created_at', entity_5.created_at,",
|
||||||
|
" 'id', entity_5.id,",
|
||||||
|
" 'name', entity_5.name,",
|
||||||
|
" 'type', entity_5.type",
|
||||||
|
" )",
|
||||||
|
" FROM agreego.email_address email_address_4",
|
||||||
|
" JOIN agreego.entity entity_5 ON entity_5.id = email_address_4.id",
|
||||||
|
" WHERE",
|
||||||
|
" NOT entity_5.archived",
|
||||||
|
" AND relationship_2.target_id = entity_5.id),",
|
||||||
|
" 'type', entity_3.type",
|
||||||
|
")",
|
||||||
|
"FROM agreego.contact contact_1",
|
||||||
|
"JOIN agreego.relationship relationship_2 ON relationship_2.id = contact_1.id",
|
||||||
|
"JOIN agreego.entity entity_3 ON entity_3.id = relationship_2.id",
|
||||||
|
"WHERE NOT entity_3.archived)"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"description": "Order select with customer and lines",
|
"description": "Order select with customer and lines",
|
||||||
"action": "query",
|
"action": "query",
|
||||||
|
|||||||
38
fixtures/t1.json
Normal file
38
fixtures/t1.json
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"description": "Person ad-hoc email addresses select",
|
||||||
|
"action": "query",
|
||||||
|
"schema_id": "full.person/email_addresses",
|
||||||
|
"expect": {
|
||||||
|
"success": true,
|
||||||
|
"sql": [
|
||||||
|
[
|
||||||
|
"(SELECT jsonb_build_object(",
|
||||||
|
" 'archived', entity_3.archived,",
|
||||||
|
" 'created_at', entity_3.created_at,",
|
||||||
|
" 'id', entity_3.id,",
|
||||||
|
" 'is_primary', contact_1.is_primary,",
|
||||||
|
" 'name', entity_3.name,",
|
||||||
|
" 'target',",
|
||||||
|
" (SELECT jsonb_build_object(",
|
||||||
|
" 'address', email_address_4.address,",
|
||||||
|
" 'archived', entity_5.archived,",
|
||||||
|
" 'created_at', entity_5.created_at,",
|
||||||
|
" 'id', entity_5.id,",
|
||||||
|
" 'name', entity_5.name,",
|
||||||
|
" 'type', entity_5.type",
|
||||||
|
" )",
|
||||||
|
" FROM agreego.email_address email_address_4",
|
||||||
|
" JOIN agreego.entity entity_5 ON entity_5.id = email_address_4.id",
|
||||||
|
" WHERE",
|
||||||
|
" NOT entity_5.archived",
|
||||||
|
" AND relationship_2.target_id = entity_5.id),",
|
||||||
|
" 'type', entity_3.type",
|
||||||
|
")",
|
||||||
|
"FROM agreego.contact contact_1",
|
||||||
|
"JOIN agreego.relationship relationship_2 ON relationship_2.id = contact_1.id",
|
||||||
|
"JOIN agreego.entity entity_3 ON entity_3.id = relationship_2.id",
|
||||||
|
"WHERE NOT entity_3.archived)"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1451,6 +1451,12 @@ fn test_queryer_0_6() {
|
|||||||
crate::tests::runner::run_test_case(&path, 0, 6).unwrap();
|
crate::tests::runner::run_test_case(&path, 0, 6).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_queryer_0_7() {
|
||||||
|
let path = format!("{}/fixtures/queryer.json", env!("CARGO_MANIFEST_DIR"));
|
||||||
|
crate::tests::runner::run_test_case(&path, 0, 7).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_not_0_0() {
|
fn test_not_0_0() {
|
||||||
let path = format!("{}/fixtures/not.json", env!("CARGO_MANIFEST_DIR"));
|
let path = format!("{}/fixtures/not.json", env!("CARGO_MANIFEST_DIR"));
|
||||||
|
|||||||
Reference in New Issue
Block a user