44 lines
30 KiB
Plaintext
44 lines
30 KiB
Plaintext
Compiling jspg v0.1.0 (/Users/awgneo/Repositories/thoughtpatterns/cellular/jspg)
|
|
warning: unused variable: `is_family`
|
|
--> src/database/schema.rs:495:9
|
|
|
|
|
495 | let is_family = self.obj.family.is_some();
|
|
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_is_family`
|
|
|
|
|
= note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default
|
|
|
|
warning: `jspg` (lib) generated 1 warning (run `cargo fix --lib -p jspg` to apply 1 suggestion)
|
|
warning: `jspg` (lib test) generated 1 warning (1 duplicate)
|
|
Finished `test` profile [unoptimized + debuginfo] target(s) in 11.66s
|
|
Running unittests src/lib.rs (target/debug/deps/jspg-d3f18ff3a7e2b386)
|
|
|
|
running 1 test
|
|
[DEBUG SPLIT] ID: light.person, dim: type, is_split: false, props: Some(["age", "archived", "created", "created_at", "first_name", "id", "last_name", "name", "type"])
|
|
[DEBUG SPLIT] ID: light.person, dim: kind, is_split: false, props: Some(["age", "archived", "created", "created_at", "first_name", "id", "last_name", "name", "type"])
|
|
[DEBUG SPLIT] ID: light.person, dim: type, is_split: false, props: Some(["age", "archived", "created", "created_at", "first_name", "id", "last_name", "name", "type"])
|
|
[DEBUG SPLIT] ID: light.person, dim: type, is_split: false, props: Some(["age", "archived", "created", "created_at", "first_name", "id", "last_name", "name", "type"])
|
|
[DEBUG SPLIT] ID: light.person, dim: kind, is_split: false, props: Some(["age", "archived", "created", "created_at", "first_name", "id", "last_name", "name", "type"])
|
|
[DEBUG SPLIT] ID: light.person, dim: type, is_split: false, props: Some(["age", "archived", "created", "created_at", "first_name", "id", "last_name", "name", "type"])
|
|
[DEBUG POLYMORPHISM] ID: get_person.response, Strategy: type, Pathways: {"full.person": "full.person", "light.person": "light.person", "person": "person"}
|
|
[DEBUG QUERYER] Evaluating node. Target family: Some("organization"), disc: Some("type"), pathways: Some({"bot": "bot", "full.person": "full.person", "get_organization.response": "get_organization.response", "light.person": "light.person", "organization": "organization", "person": "person"})
|
|
JSPG_SQL: (SELECT jsonb_strip_nulls((SELECT COALESCE(jsonb_agg(jsonb_build_object('id', organization_1.id, 'type', CASE WHEN organization_1.type = 'bot' THEN ((SELECT jsonb_build_object('archived', entity_5.archived, 'created_at', entity_5.created_at, 'id', entity_5.id, 'name', organization_4.name, 'token', bot_3.token, 'type', entity_5.type) FROM agreego.bot bot_3 JOIN agreego.organization organization_4 ON organization_4.id = bot_3.id JOIN agreego.entity entity_5 ON entity_5.id = organization_4.id WHERE NOT entity_5.archived)) WHEN organization_1.type = 'full.person' THEN ((SELECT jsonb_build_object('addresses', (SELECT COALESCE(jsonb_agg(jsonb_build_object('archived', entity_11.archived, 'created_at', entity_11.created_at, 'id', entity_11.id, 'is_primary', contact_9.is_primary, 'target', (SELECT jsonb_build_object('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_12 JOIN agreego.entity entity_13 ON entity_13.id = address_12.id WHERE NOT entity_13.archived AND relationship_10.target_id = entity_13.id), 'type', entity_11.type)), '[]'::jsonb) FROM agreego.contact contact_9 JOIN agreego.relationship relationship_10 ON relationship_10.id = contact_9.id JOIN agreego.entity entity_11 ON entity_11.id = relationship_10.id WHERE NOT entity_11.archived AND relationship_10.target_type = 'address' AND relationship_10.source_id = entity_8.id), 'age', person_6.age, 'archived', entity_8.archived, 'contacts', (SELECT COALESCE(jsonb_agg(jsonb_build_object('archived', entity_16.archived, 'created_at', entity_16.created_at, 'id', entity_16.id, 'is_primary', contact_14.is_primary, 'target', CASE WHEN entity_16.target_type = 'address' THEN ((SELECT jsonb_build_object('archived', entity_18.archived, 'city', address_17.city, 'created_at', entity_18.created_at, 'id', entity_18.id, 'type', entity_18.type) FROM agreego.address address_17 JOIN agreego.entity entity_18 ON entity_18.id = address_17.id WHERE NOT entity_18.archived AND relationship_15.target_id = entity_18.id)) WHEN entity_16.target_type = 'email_address' THEN ((SELECT jsonb_build_object('address', email_address_19.address, 'archived', entity_20.archived, 'created_at', entity_20.created_at, 'id', entity_20.id, 'type', entity_20.type) FROM agreego.email_address email_address_19 JOIN agreego.entity entity_20 ON entity_20.id = email_address_19.id WHERE NOT entity_20.archived AND relationship_15.target_id = entity_20.id)) WHEN entity_16.target_type = 'phone_number' THEN ((SELECT jsonb_build_object('archived', entity_22.archived, 'created_at', entity_22.created_at, 'id', entity_22.id, 'number', phone_number_21.number, 'type', entity_22.type) FROM agreego.phone_number phone_number_21 JOIN agreego.entity entity_22 ON entity_22.id = phone_number_21.id WHERE NOT entity_22.archived AND relationship_15.target_id = entity_22.id)) ELSE NULL END, 'type', entity_16.type)), '[]'::jsonb) FROM agreego.contact contact_14 JOIN agreego.relationship relationship_15 ON relationship_15.id = contact_14.id JOIN agreego.entity entity_16 ON entity_16.id = relationship_15.id WHERE NOT entity_16.archived AND relationship_15.source_id = entity_8.id), 'created_at', entity_8.created_at, 'email_addresses', (SELECT COALESCE(jsonb_agg(jsonb_build_object('archived', entity_25.archived, 'created_at', entity_25.created_at, 'id', entity_25.id, 'is_primary', contact_23.is_primary, 'target', (SELECT jsonb_build_object('address', email_address_26.address, 'archived', entity_27.archived, 'created_at', entity_27.created_at, 'id', entity_27.id, 'type', entity_27.type) FROM agreego.email_address email_address_26 JOIN agreego.entity entity_27 ON entity_27.id = email_address_26.id WHERE NOT entity_27.archived AND relationship_24.target_id = entity_27.id), 'type', entity_25.type)), '[]'::jsonb) FROM agreego.contact contact_23 JOIN agreego.relationship relationship_24 ON relationship_24.id = contact_23.id JOIN agreego.entity entity_25 ON entity_25.id = relationship_24.id WHERE NOT entity_25.archived AND relationship_24.target_type = 'email_address' AND relationship_24.source_id = entity_8.id), 'first_name', person_6.first_name, 'id', entity_8.id, 'last_name', person_6.last_name, 'name', organization_7.name, 'phone_numbers', (SELECT COALESCE(jsonb_agg(jsonb_build_object('archived', entity_30.archived, 'created_at', entity_30.created_at, 'id', entity_30.id, 'is_primary', contact_28.is_primary, 'target', (SELECT jsonb_build_object('archived', entity_32.archived, 'created_at', entity_32.created_at, 'id', entity_32.id, 'number', phone_number_31.number, 'type', entity_32.type) FROM agreego.phone_number phone_number_31 JOIN agreego.entity entity_32 ON entity_32.id = phone_number_31.id WHERE NOT entity_32.archived AND relationship_29.target_id = entity_32.id), 'type', entity_30.type)), '[]'::jsonb) FROM agreego.contact contact_28 JOIN agreego.relationship relationship_29 ON relationship_29.id = contact_28.id JOIN agreego.entity entity_30 ON entity_30.id = relationship_29.id WHERE NOT entity_30.archived AND relationship_29.target_type = 'phone_number' AND relationship_29.source_id = entity_8.id), 'type', entity_8.type) FROM agreego.person person_6 JOIN agreego.organization organization_7 ON organization_7.id = person_6.id JOIN agreego.entity entity_8 ON entity_8.id = organization_7.id WHERE NOT entity_8.archived)) WHEN organization_1.type = 'get_organization.response' THEN ((SELECT jsonb_build_object('archived', entity_34.archived, 'created_at', entity_34.created_at, 'id', entity_34.id, 'name', organization_33.name, 'type', entity_34.type) FROM agreego.organization organization_33 JOIN agreego.entity entity_34 ON entity_34.id = organization_33.id WHERE NOT entity_34.archived)) WHEN organization_1.type = 'light.person' THEN ((SELECT jsonb_build_object('age', person_35.age, 'archived', entity_37.archived, 'created_at', entity_37.created_at, 'first_name', person_35.first_name, 'id', entity_37.id, 'last_name', person_35.last_name, 'name', organization_36.name, 'type', entity_37.type) FROM agreego.person person_35 JOIN agreego.organization organization_36 ON organization_36.id = person_35.id JOIN agreego.entity entity_37 ON entity_37.id = organization_36.id WHERE NOT entity_37.archived)) WHEN organization_1.type = 'organization' THEN ((SELECT jsonb_build_object('archived', entity_39.archived, 'created_at', entity_39.created_at, 'id', entity_39.id, 'name', organization_38.name, 'type', entity_39.type) FROM agreego.organization organization_38 JOIN agreego.entity entity_39 ON entity_39.id = organization_38.id WHERE NOT entity_39.archived)) WHEN organization_1.type = 'person' THEN ((SELECT jsonb_build_object('age', person_40.age, 'archived', entity_42.archived, 'created_at', entity_42.created_at, 'first_name', person_40.first_name, 'id', entity_42.id, 'last_name', person_40.last_name, 'name', organization_41.name, 'type', entity_42.type) FROM agreego.person person_40 JOIN agreego.organization organization_41 ON organization_41.id = person_40.id JOIN agreego.entity entity_42 ON entity_42.id = organization_41.id WHERE NOT entity_42.archived)) ELSE NULL END)), '[]'::jsonb) FROM agreego.organization organization_1 JOIN agreego.entity entity_2 ON entity_2.id = organization_1.id WHERE NOT entity_2.archived)))
|
|
TEST QUERY ERROR FOR 'Organizations select via a punc response with family': Line mismatched at execution sequence 1.
|
|
Expected Pattern: (SELECT jsonb_strip_nulls((SELECT COALESCE(jsonb_agg(jsonb_build_object('id',organization_1.id,'type',CASE WHEN organization_1.type='bot'THEN((SELECT jsonb_build_object('archived',entity_5.archived,'created_at',entity_5.created_at,'id',entity_5.id,'name',organization_4.name,'token',bot_3.token,'type',entity_5.type)FROM agreego.bot bot_3 JOIN agreego.organization organization_4 ON organization_4.id=bot_3.id JOIN agreego.entity entity_5 ON entity_5.id=organization_4.id WHERE NOT entity_5.archived))WHEN organization_1.type='organization'THEN((SELECT jsonb_build_object('archived',entity_7.archived,'created_at',entity_7.created_at,'id',entity_7.id,'name',organization_6.name,'type',entity_7.type)FROM agreego.organization organization_6 JOIN agreego.entity entity_7 ON entity_7.id=organization_6.id WHERE NOT entity_7.archived))WHEN organization_1.type='person'THEN((SELECT jsonb_build_object('age',person_8.age,'archived',entity_10.archived,'created_at',entity_10.created_at,'first_name',person_8.first_name,'id',entity_10.id,'last_name',person_8.last_name,'name',organization_9.name,'type',entity_10.type)FROM agreego.person person_8 JOIN agreego.organization organization_9 ON organization_9.id=person_8.id JOIN agreego.entity entity_10 ON entity_10.id=organization_9.id WHERE NOT entity_10.archived))ELSE NULL END)),'[]'::jsonb)FROM agreego.organization organization_1 JOIN agreego.entity entity_2 ON entity_2.id=organization_1.id WHERE NOT entity_2.archived)))
|
|
Actual SQL: (SELECT jsonb_strip_nulls((SELECT COALESCE(jsonb_agg(jsonb_build_object('id',organization_1.id,'type',CASE WHEN organization_1.type='bot'THEN((SELECT jsonb_build_object('archived',entity_5.archived,'created_at',entity_5.created_at,'id',entity_5.id,'name',organization_4.name,'token',bot_3.token,'type',entity_5.type)FROM agreego.bot bot_3 JOIN agreego.organization organization_4 ON organization_4.id=bot_3.id JOIN agreego.entity entity_5 ON entity_5.id=organization_4.id WHERE NOT entity_5.archived))WHEN organization_1.type='full.person'THEN((SELECT jsonb_build_object('addresses',(SELECT COALESCE(jsonb_agg(jsonb_build_object('archived',entity_11.archived,'created_at',entity_11.created_at,'id',entity_11.id,'is_primary',contact_9.is_primary,'target',(SELECT jsonb_build_object('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_12 JOIN agreego.entity entity_13 ON entity_13.id=address_12.id WHERE NOT entity_13.archived AND relationship_10.target_id=entity_13.id),'type',entity_11.type)),'[]'::jsonb)FROM agreego.contact contact_9 JOIN agreego.relationship relationship_10 ON relationship_10.id=contact_9.id JOIN agreego.entity entity_11 ON entity_11.id=relationship_10.id WHERE NOT entity_11.archived AND relationship_10.target_type='address'AND relationship_10.source_id=entity_8.id),'age',person_6.age,'archived',entity_8.archived,'contacts',(SELECT COALESCE(jsonb_agg(jsonb_build_object('archived',entity_16.archived,'created_at',entity_16.created_at,'id',entity_16.id,'is_primary',contact_14.is_primary,'target',CASE WHEN entity_16.target_type='address'THEN((SELECT jsonb_build_object('archived',entity_18.archived,'city',address_17.city,'created_at',entity_18.created_at,'id',entity_18.id,'type',entity_18.type)FROM agreego.address address_17 JOIN agreego.entity entity_18 ON entity_18.id=address_17.id WHERE NOT entity_18.archived AND relationship_15.target_id=entity_18.id))WHEN entity_16.target_type='email_address'THEN((SELECT jsonb_build_object('address',email_address_19.address,'archived',entity_20.archived,'created_at',entity_20.created_at,'id',entity_20.id,'type',entity_20.type)FROM agreego.email_address email_address_19 JOIN agreego.entity entity_20 ON entity_20.id=email_address_19.id WHERE NOT entity_20.archived AND relationship_15.target_id=entity_20.id))WHEN entity_16.target_type='phone_number'THEN((SELECT jsonb_build_object('archived',entity_22.archived,'created_at',entity_22.created_at,'id',entity_22.id,'number',phone_number_21.number,'type',entity_22.type)FROM agreego.phone_number phone_number_21 JOIN agreego.entity entity_22 ON entity_22.id=phone_number_21.id WHERE NOT entity_22.archived AND relationship_15.target_id=entity_22.id))ELSE NULL END,'type',entity_16.type)),'[]'::jsonb)FROM agreego.contact contact_14 JOIN agreego.relationship relationship_15 ON relationship_15.id=contact_14.id JOIN agreego.entity entity_16 ON entity_16.id=relationship_15.id WHERE NOT entity_16.archived AND relationship_15.source_id=entity_8.id),'created_at',entity_8.created_at,'email_addresses',(SELECT COALESCE(jsonb_agg(jsonb_build_object('archived',entity_25.archived,'created_at',entity_25.created_at,'id',entity_25.id,'is_primary',contact_23.is_primary,'target',(SELECT jsonb_build_object('address',email_address_26.address,'archived',entity_27.archived,'created_at',entity_27.created_at,'id',entity_27.id,'type',entity_27.type)FROM agreego.email_address email_address_26 JOIN agreego.entity entity_27 ON entity_27.id=email_address_26.id WHERE NOT entity_27.archived AND relationship_24.target_id=entity_27.id),'type',entity_25.type)),'[]'::jsonb)FROM agreego.contact contact_23 JOIN agreego.relationship relationship_24 ON relationship_24.id=contact_23.id JOIN agreego.entity entity_25 ON entity_25.id=relationship_24.id WHERE NOT entity_25.archived AND relationship_24.target_type='email_address'AND relationship_24.source_id=entity_8.id),'first_name',person_6.first_name,'id',entity_8.id,'last_name',person_6.last_name,'name',organization_7.name,'phone_numbers',(SELECT COALESCE(jsonb_agg(jsonb_build_object('archived',entity_30.archived,'created_at',entity_30.created_at,'id',entity_30.id,'is_primary',contact_28.is_primary,'target',(SELECT jsonb_build_object('archived',entity_32.archived,'created_at',entity_32.created_at,'id',entity_32.id,'number',phone_number_31.number,'type',entity_32.type)FROM agreego.phone_number phone_number_31 JOIN agreego.entity entity_32 ON entity_32.id=phone_number_31.id WHERE NOT entity_32.archived AND relationship_29.target_id=entity_32.id),'type',entity_30.type)),'[]'::jsonb)FROM agreego.contact contact_28 JOIN agreego.relationship relationship_29 ON relationship_29.id=contact_28.id JOIN agreego.entity entity_30 ON entity_30.id=relationship_29.id WHERE NOT entity_30.archived AND relationship_29.target_type='phone_number'AND relationship_29.source_id=entity_8.id),'type',entity_8.type)FROM agreego.person person_6 JOIN agreego.organization organization_7 ON organization_7.id=person_6.id JOIN agreego.entity entity_8 ON entity_8.id=organization_7.id WHERE NOT entity_8.archived))WHEN organization_1.type='get_organization.response'THEN((SELECT jsonb_build_object('archived',entity_34.archived,'created_at',entity_34.created_at,'id',entity_34.id,'name',organization_33.name,'type',entity_34.type)FROM agreego.organization organization_33 JOIN agreego.entity entity_34 ON entity_34.id=organization_33.id WHERE NOT entity_34.archived))WHEN organization_1.type='light.person'THEN((SELECT jsonb_build_object('age',person_35.age,'archived',entity_37.archived,'created_at',entity_37.created_at,'first_name',person_35.first_name,'id',entity_37.id,'last_name',person_35.last_name,'name',organization_36.name,'type',entity_37.type)FROM agreego.person person_35 JOIN agreego.organization organization_36 ON organization_36.id=person_35.id JOIN agreego.entity entity_37 ON entity_37.id=organization_36.id WHERE NOT entity_37.archived))WHEN organization_1.type='organization'THEN((SELECT jsonb_build_object('archived',entity_39.archived,'created_at',entity_39.created_at,'id',entity_39.id,'name',organization_38.name,'type',entity_39.type)FROM agreego.organization organization_38 JOIN agreego.entity entity_39 ON entity_39.id=organization_38.id WHERE NOT entity_39.archived))WHEN organization_1.type='person'THEN((SELECT jsonb_build_object('age',person_40.age,'archived',entity_42.archived,'created_at',entity_42.created_at,'first_name',person_40.first_name,'id',entity_42.id,'last_name',person_40.last_name,'name',organization_41.name,'type',entity_42.type)FROM agreego.person person_40 JOIN agreego.organization organization_41 ON organization_41.id=person_40.id JOIN agreego.entity entity_42 ON entity_42.id=organization_41.id WHERE NOT entity_42.archived))ELSE NULL END)),'[]'::jsonb)FROM agreego.organization organization_1 JOIN agreego.entity entity_2 ON entity_2.id=organization_1.id WHERE NOT entity_2.archived)))
|
|
Regex used: \(SELECT jsonb_strip_nulls\(\(SELECT COALESCE\(jsonb_agg\(jsonb_build_object\('id',organization_1\.id,'type',CASE WHEN organization_1\.type='bot'THEN\(\(SELECT jsonb_build_object\('archived',entity_5\.archived,'created_at',entity_5\.created_at,'id',entity_5\.id,'name',organization_4\.name,'token',bot_3\.token,'type',entity_5\.type\)FROM agreego\.bot bot_3 JOIN agreego\.organization organization_4 ON organization_4\.id=bot_3\.id JOIN agreego\.entity entity_5 ON entity_5\.id=organization_4\.id WHERE NOT entity_5\.archived\)\)WHEN organization_1\.type='organization'THEN\(\(SELECT jsonb_build_object\('archived',entity_7\.archived,'created_at',entity_7\.created_at,'id',entity_7\.id,'name',organization_6\.name,'type',entity_7\.type\)FROM agreego\.organization organization_6 JOIN agreego\.entity entity_7 ON entity_7\.id=organization_6\.id WHERE NOT entity_7\.archived\)\)WHEN organization_1\.type='person'THEN\(\(SELECT jsonb_build_object\('age',person_8\.age,'archived',entity_10\.archived,'created_at',entity_10\.created_at,'first_name',person_8\.first_name,'id',entity_10\.id,'last_name',person_8\.last_name,'name',organization_9\.name,'type',entity_10\.type\)FROM agreego\.person person_8 JOIN agreego\.organization organization_9 ON organization_9\.id=person_8\.id JOIN agreego\.entity entity_10 ON entity_10\.id=organization_9\.id WHERE NOT entity_10\.archived\)\)ELSE NULL END\)\),'\[\]'::jsonb\)FROM agreego\.organization organization_1 JOIN agreego\.entity entity_2 ON entity_2\.id=organization_1\.id WHERE NOT entity_2\.archived\)\)\)
|
|
Variables Mapped: {}
|
|
|
|
thread 'tests::test_queryer_0_8' (97338607) panicked at src/tests/fixtures.rs:1427:54:
|
|
called `Result::unwrap()` on an `Err` value: "[Queryer Execution] Query Test 'Organizations select via a punc response with family' failed. Error: Line mismatched at execution sequence 1.\nExpected Pattern: (SELECT jsonb_strip_nulls((SELECT COALESCE(jsonb_agg(jsonb_build_object('id',organization_1.id,'type',CASE WHEN organization_1.type='bot'THEN((SELECT jsonb_build_object('archived',entity_5.archived,'created_at',entity_5.created_at,'id',entity_5.id,'name',organization_4.name,'token',bot_3.token,'type',entity_5.type)FROM agreego.bot bot_3 JOIN agreego.organization organization_4 ON organization_4.id=bot_3.id JOIN agreego.entity entity_5 ON entity_5.id=organization_4.id WHERE NOT entity_5.archived))WHEN organization_1.type='organization'THEN((SELECT jsonb_build_object('archived',entity_7.archived,'created_at',entity_7.created_at,'id',entity_7.id,'name',organization_6.name,'type',entity_7.type)FROM agreego.organization organization_6 JOIN agreego.entity entity_7 ON entity_7.id=organization_6.id WHERE NOT entity_7.archived))WHEN organization_1.type='person'THEN((SELECT jsonb_build_object('age',person_8.age,'archived',entity_10.archived,'created_at',entity_10.created_at,'first_name',person_8.first_name,'id',entity_10.id,'last_name',person_8.last_name,'name',organization_9.name,'type',entity_10.type)FROM agreego.person person_8 JOIN agreego.organization organization_9 ON organization_9.id=person_8.id JOIN agreego.entity entity_10 ON entity_10.id=organization_9.id WHERE NOT entity_10.archived))ELSE NULL END)),'[]'::jsonb)FROM agreego.organization organization_1 JOIN agreego.entity entity_2 ON entity_2.id=organization_1.id WHERE NOT entity_2.archived)))\nActual SQL: (SELECT jsonb_strip_nulls((SELECT COALESCE(jsonb_agg(jsonb_build_object('id',organization_1.id,'type',CASE WHEN organization_1.type='bot'THEN((SELECT jsonb_build_object('archived',entity_5.archived,'created_at',entity_5.created_at,'id',entity_5.id,'name',organization_4.name,'token',bot_3.token,'type',entity_5.type)FROM agreego.bot bot_3 JOIN agreego.organization organization_4 ON organization_4.id=bot_3.id JOIN agreego.entity entity_5 ON entity_5.id=organization_4.id WHERE NOT entity_5.archived))WHEN organization_1.type='full.person'THEN((SELECT jsonb_build_object('addresses',(SELECT COALESCE(jsonb_agg(jsonb_build_object('archived',entity_11.archived,'created_at',entity_11.created_at,'id',entity_11.id,'is_primary',contact_9.is_primary,'target',(SELECT jsonb_build_object('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_12 JOIN agreego.entity entity_13 ON entity_13.id=address_12.id WHERE NOT entity_13.archived AND relationship_10.target_id=entity_13.id),'type',entity_11.type)),'[]'::jsonb)FROM agreego.contact contact_9 JOIN agreego.relationship relationship_10 ON relationship_10.id=contact_9.id JOIN agreego.entity entity_11 ON entity_11.id=relationship_10.id WHERE NOT entity_11.archived AND relationship_10.target_type='address'AND relationship_10.source_id=entity_8.id),'age',person_6.age,'archived',entity_8.archived,'contacts',(SELECT COALESCE(jsonb_agg(jsonb_build_object('archived',entity_16.archived,'created_at',entity_16.created_at,'id',entity_16.id,'is_primary',contact_14.is_primary,'target',CASE WHEN entity_16.target_type='address'THEN((SELECT jsonb_build_object('archived',entity_18.archived,'city',address_17.city,'created_at',entity_18.created_at,'id',entity_18.id,'type',entity_18.type)FROM agreego.address address_17 JOIN agreego.entity entity_18 ON entity_18.id=address_17.id WHERE NOT entity_18.archived AND relationship_15.target_id=entity_18.id))WHEN entity_16.target_type='email_address'THEN((SELECT jsonb_build_object('address',email_address_19.address,'archived',entity_20.archived,'created_at',entity_20.created_at,'id',entity_20.id,'type',entity_20.type)FROM agreego.email_address email_address_19 JOIN agreego.entity entity_20 ON entity_20.id=email_address_19.id WHERE NOT entity_20.archived AND relationship_15.target_id=entity_20.id))WHEN entity_16.target_type='phone_number'THEN((SELECT jsonb_build_object('archived',entity_22.archived,'created_at',entity_22.created_at,'id',entity_22.id,'number',phone_number_21.number,'type',entity_22.type)FROM agreego.phone_number phone_number_21 JOIN agreego.entity entity_22 ON entity_22.id=phone_number_21.id WHERE NOT entity_22.archived AND relationship_15.target_id=entity_22.id))ELSE NULL END,'type',entity_16.type)),'[]'::jsonb)FROM agreego.contact contact_14 JOIN agreego.relationship relationship_15 ON relationship_15.id=contact_14.id JOIN agreego.entity entity_16 ON entity_16.id=relationship_15.id WHERE NOT entity_16.archived AND relationship_15.source_id=entity_8.id),'created_at',entity_8.created_at,'email_addresses',(SELECT COALESCE(jsonb_agg(jsonb_build_object('archived',entity_25.archived,'created_at',entity_25.created_at,'id',entity_25.id,'is_primary',contact_23.is_primary,'target',(SELECT jsonb_build_object('address',email_address_26.address,'archived',entity_27.archived,'created_at',entity_27.created_at,'id',entity_27.id,'type',entity_27.type)FROM agreego.email_address email_address_26 JOIN agreego.entity entity_27 ON entity_27.id=email_address_26.id WHERE NOT entity_27.archived AND relationship_24.target_id=entity_27.id),'type',entity_25.type)),'[]'::jsonb)FROM agreego.contact contact_23 JOIN agreego.relationship relationship_24 ON relationship_24.id=contact_23.id JOIN agreego.entity entity_25 ON entity_25.id=relationship_24.id WHERE NOT entity_25.archived AND relationship_24.target_type='email_address'AND relationship_24.source_id=entity_8.id),'first_name',person_6.first_name,'id',entity_8.id,'last_name',person_6.last_name,'name',organization_7.name,'phone_numbers',(SELECT COALESCE(jsonb_agg(jsonb_build_object('archived',entity_30.archived,'created_at',entity_30.created_at,'id',entity_30.id,'is_primary',contact_28.is_primary,'target',(SELECT jsonb_build_object('archived',entity_32.archived,'created_at',entity_32.created_at,'id',entity_32.id,'number',phone_number_31.number,'type',entity_32.type)FROM agreego.phone_number phone_number_31 JOIN agreego.entity entity_32 ON entity_32.id=phone_number_31.id WHERE NOT entity_32.archived AND relationship_29.target_id=entity_32.id),'type',entity_30.type)),'[]'::jsonb)FROM agreego.contact contact_28 JOIN agreego.relationship relationship_29 ON relationship_29.id=contact_28.id JOIN agreego.entity entity_30 ON entity_30.id=relationship_29.id WHERE NOT entity_30.archived AND relationship_29.target_type='phone_number'AND relationship_29.source_id=entity_8.id),'type',entity_8.type)FROM agreego.person person_6 JOIN agreego.organization organization_7 ON organization_7.id=person_6.id JOIN agreego.entity entity_8 ON entity_8.id=organization_7.id WHERE NOT entity_8.archived))WHEN organization_1.type='get_organization.response'THEN((SELECT jsonb_build_object('archived',entity_34.archived,'created_at',entity_34.created_at,'id',entity_34.id,'name',organization_33.name,'type',entity_34.type)FROM agreego.organization organization_33 JOIN agreego.entity entity_34 ON entity_34.id=organization_33.id WHERE NOT entity_34.archived))WHEN organization_1.type='light.person'THEN((SELECT jsonb_build_object('age',person_35.age,'archived',entity_37.archived,'created_at',entity_37.created_at,'first_name',person_35.first_name,'id',entity_37.id,'last_name',person_35.last_name,'name',organization_36.name,'type',entity_37.type)FROM agreego.person person_35 JOIN agreego.organization organization_36 ON organization_36.id=person_35.id JOIN agreego.entity entity_37 ON entity_37.id=organization_36.id WHERE NOT entity_37.archived))WHEN organization_1.type='organization'THEN((SELECT jsonb_build_object('archived',entity_39.archived,'created_at',entity_39.created_at,'id',entity_39.id,'name',organization_38.name,'type',entity_39.type)FROM agreego.organization organization_38 JOIN agreego.entity entity_39 ON entity_39.id=organization_38.id WHERE NOT entity_39.archived))WHEN organization_1.type='person'THEN((SELECT jsonb_build_object('age',person_40.age,'archived',entity_42.archived,'created_at',entity_42.created_at,'first_name',person_40.first_name,'id',entity_42.id,'last_name',person_40.last_name,'name',organization_41.name,'type',entity_42.type)FROM agreego.person person_40 JOIN agreego.organization organization_41 ON organization_41.id=person_40.id JOIN agreego.entity entity_42 ON entity_42.id=organization_41.id WHERE NOT entity_42.archived))ELSE NULL END)),'[]'::jsonb)FROM agreego.organization organization_1 JOIN agreego.entity entity_2 ON entity_2.id=organization_1.id WHERE NOT entity_2.archived)))\nRegex used: \\(SELECT jsonb_strip_nulls\\(\\(SELECT COALESCE\\(jsonb_agg\\(jsonb_build_object\\('id',organization_1\\.id,'type',CASE WHEN organization_1\\.type='bot'THEN\\(\\(SELECT jsonb_build_object\\('archived',entity_5\\.archived,'created_at',entity_5\\.created_at,'id',entity_5\\.id,'name',organization_4\\.name,'token',bot_3\\.token,'type',entity_5\\.type\\)FROM agreego\\.bot bot_3 JOIN agreego\\.organization organization_4 ON organization_4\\.id=bot_3\\.id JOIN agreego\\.entity entity_5 ON entity_5\\.id=organization_4\\.id WHERE NOT entity_5\\.archived\\)\\)WHEN organization_1\\.type='organization'THEN\\(\\(SELECT jsonb_build_object\\('archived',entity_7\\.archived,'created_at',entity_7\\.created_at,'id',entity_7\\.id,'name',organization_6\\.name,'type',entity_7\\.type\\)FROM agreego\\.organization organization_6 JOIN agreego\\.entity entity_7 ON entity_7\\.id=organization_6\\.id WHERE NOT entity_7\\.archived\\)\\)WHEN organization_1\\.type='person'THEN\\(\\(SELECT jsonb_build_object\\('age',person_8\\.age,'archived',entity_10\\.archived,'created_at',entity_10\\.created_at,'first_name',person_8\\.first_name,'id',entity_10\\.id,'last_name',person_8\\.last_name,'name',organization_9\\.name,'type',entity_10\\.type\\)FROM agreego\\.person person_8 JOIN agreego\\.organization organization_9 ON organization_9\\.id=person_8\\.id JOIN agreego\\.entity entity_10 ON entity_10\\.id=organization_9\\.id WHERE NOT entity_10\\.archived\\)\\)ELSE NULL END\\)\\),'\\[\\]'::jsonb\\)FROM agreego\\.organization organization_1 JOIN agreego\\.entity entity_2 ON entity_2\\.id=organization_1\\.id WHERE NOT entity_2\\.archived\\)\\)\\)\nVariables Mapped: {}"
|
|
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
|
test tests::test_queryer_0_8 ... FAILED
|
|
|
|
failures:
|
|
|
|
failures:
|
|
tests::test_queryer_0_8
|
|
|
|
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1350 filtered out; finished in 0.01s
|
|
|
|
error: test failed, to rerun pass `--lib`
|