queryer fixes

This commit is contained in:
2026-03-18 02:41:56 -04:00
parent 02e661d219
commit 330280ba48
5 changed files with 562 additions and 638 deletions

View File

@ -1024,7 +1024,7 @@
" JOIN agreego.entity entity_6 ON entity_6.id = relationship_5.id",
" WHERE",
" NOT entity_6.archived",
" AND contact_4.parent_id = entity_3.id),",
" AND contact_4.source_id = entity_3.id),",
" 'age', person_1.age,",
" 'archived', entity_3.archived,",
" 'contacts',",
@ -1085,7 +1085,7 @@
" JOIN agreego.entity entity_11 ON entity_11.id = relationship_10.id",
" WHERE",
" NOT entity_11.archived",
" AND contact_9.parent_id = entity_3.id),",
" AND contact_9.source_id = entity_3.id),",
" 'created_at', entity_3.created_at,",
" 'email_addresses',",
" (SELECT COALESCE(jsonb_agg(jsonb_build_object(",
@ -1115,7 +1115,7 @@
" JOIN agreego.entity entity_20 ON entity_20.id = relationship_19.id",
" WHERE",
" NOT entity_20.archived",
" AND contact_18.parent_id = entity_3.id),",
" AND contact_18.source_id = entity_3.id),",
" 'first_name', person_1.first_name,",
" 'id', entity_3.id,",
" 'last_name', person_1.last_name,",
@ -1148,7 +1148,7 @@
" JOIN agreego.entity entity_25 ON entity_25.id = relationship_24.id",
" WHERE",
" NOT entity_25.archived",
" AND contact_23.parent_id = entity_3.id),",
" AND contact_23.source_id = entity_3.id),",
" 'type', entity_3.type",
")",
"FROM agreego.person person_1",
@ -1261,7 +1261,7 @@
" JOIN agreego.entity entity_6 ON entity_6.id = relationship_5.id",
" WHERE",
" NOT entity_6.archived",
" AND contact_4.parent_id = entity_3.id),",
" AND contact_4.source_id = entity_3.id),",
" 'age', person_1.age,",
" 'archived', entity_3.archived,",
" 'contacts',",
@ -1323,7 +1323,7 @@
" WHERE",
" NOT entity_11.archived",
" AND contact_9.is_primary = ($11#>>'{}')::boolean",
" AND contact_9.parent_id = entity_3.id),",
" AND contact_9.source_id = entity_3.id),",
" 'created_at', entity_3.created_at,",
" 'email_addresses',",
" (SELECT COALESCE(jsonb_agg(jsonb_build_object(",
@ -1353,7 +1353,7 @@
" JOIN agreego.entity entity_20 ON entity_20.id = relationship_19.id",
" WHERE",
" NOT entity_20.archived",
" AND contact_18.parent_id = entity_3.id),",
" AND contact_18.source_id = entity_3.id),",
" 'first_name', person_1.first_name,",
" 'id', entity_3.id,",
" 'last_name', person_1.last_name,",
@ -1387,7 +1387,7 @@
" JOIN agreego.entity entity_25 ON entity_25.id = relationship_24.id",
" WHERE",
" NOT entity_25.archived",
" AND contact_23.parent_id = entity_3.id),",
" AND contact_23.source_id = entity_3.id),",
" 'type', entity_3.type",
")",
"FROM agreego.person person_1",