test cleanup

This commit is contained in:
2026-03-11 21:11:31 -04:00
parent e692fc52ee
commit 44ba3e0e18
607 changed files with 214852 additions and 54 deletions

View File

@ -420,13 +420,96 @@
"expect": {
"success": true,
"sql": [
"SELECT to_jsonb(t1.*) || to_jsonb(t2.*) || to_jsonb(t3.*) || to_jsonb(t4.*) FROM agreego.\"person\" t1 LEFT JOIN agreego.\"user\" t2 ON t2.id = t1.id LEFT JOIN agreego.\"organization\" t3 ON t3.id = t1.id LEFT JOIN agreego.\"entity\" t4 ON t4.id = t1.id WHERE t1.id = '123'",
"INSERT INTO agreego.\"entity\" (\"created_at\", \"created_by\", \"id\", \"modified_at\", \"modified_by\", \"type\") VALUES ('{{timestamp}}', '00000000-0000-0000-0000-000000000000', '123', '{{timestamp}}', '00000000-0000-0000-0000-000000000000', 'person')",
"INSERT INTO agreego.\"organization\" (\"id\", \"type\") VALUES ('123', 'person')",
"INSERT INTO agreego.\"user\" (\"id\", \"type\") VALUES ('123', 'person')",
"INSERT INTO agreego.\"person\" (\"date_of_birth\", \"first_name\", \"id\", \"last_name\", \"type\") VALUES ('1990-01-01T00:00:00Z', 'John', '123', 'Doe', 'person')",
"INSERT INTO agreego.change (changes, entity_id, id, kind, modified_at, modified_by) VALUES ('{\"date_of_birth\":\"1990-01-01T00:00:00Z\",\"first_name\":\"John\",\"last_name\":\"Doe\",\"type\":\"person\"}', '123', '{{uuid}}', 'create', '{{timestamp}}', '00000000-0000-0000-0000-000000000000')",
"SELECT pg_notify('entity', '{\"complete\":{\"created_at\":\"{{timestamp}}\",\"created_by\":\"00000000-0000-0000-0000-000000000000\",\"date_of_birth\":\"1990-01-01T00:00:00Z\",\"first_name\":\"John\",\"id\":\"123\",\"last_name\":\"Doe\",\"modified_at\":\"{{timestamp}}\",\"modified_by\":\"00000000-0000-0000-0000-000000000000\",\"type\":\"person\"}}')"
[
"SELECT to_jsonb(t1.*) || to_jsonb(t2.*) || to_jsonb(t3.*) || to_jsonb(t4.*)",
"FROM agreego.\"person\" t1",
"LEFT JOIN agreego.\"user\" t2 ON t2.id = t1.id",
"LEFT JOIN agreego.\"organization\" t3 ON t3.id = t1.id",
"LEFT JOIN agreego.\"entity\" t4 ON t4.id = t1.id",
"WHERE t1.id = '123'"
],
[
"INSERT INTO agreego.\"entity\" (",
" \"created_at\",",
" \"created_by\",",
" \"id\",",
" \"modified_at\",",
" \"modified_by\",",
" \"type\")",
"VALUES (",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000',",
" '123',",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000',",
" 'person'",
")"
],
[
"INSERT INTO agreego.\"organization\" (",
" \"id\",",
" \"type\")",
"VALUES ('123', 'person')"
],
[
"INSERT INTO agreego.\"user\" (",
" \"id\",",
" \"type\")",
"VALUES ('123', 'person')"
],
[
"INSERT INTO agreego.\"person\" (",
" \"date_of_birth\",",
" \"first_name\",",
" \"id\",",
" \"last_name\",",
" \"type\")",
"VALUES (",
" '1990-01-01T00:00:00Z',",
" 'John',",
" '123',",
" 'Doe',",
" 'person'",
")"
],
[
"INSERT INTO agreego.change (",
" changes,",
" entity_id,",
" id,",
" kind,",
" modified_at,",
" modified_by",
")",
"VALUES (",
" '{",
" \"date_of_birth\":\"1990-01-01T00:00:00Z\",",
" \"first_name\":\"John\",",
" \"last_name\":\"Doe\",",
" \"type\":\"person\"",
" }',",
" '123',",
" '{{uuid}}',",
" 'create',",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000'",
")"
],
[
"SELECT pg_notify('entity', '{",
" \"complete\":{",
" \"created_at\":\"{{timestamp}}\",",
" \"created_by\":\"00000000-0000-0000-0000-000000000000\",",
" \"date_of_birth\":\"1990-01-01T00:00:00Z\",",
" \"first_name\":\"John\",",
" \"id\":\"123\",",
" \"last_name\":\"Doe\",",
" \"modified_at\":\"{{timestamp}}\",",
" \"modified_by\":\"00000000-0000-0000-0000-000000000000\",",
" \"type\":\"person\"",
" }",
"}')"
]
]
}
},
@ -442,13 +525,108 @@
"expect": {
"success": true,
"sql": [
"SELECT to_jsonb(t1.*) || to_jsonb(t2.*) || to_jsonb(t3.*) || to_jsonb(t4.*) FROM agreego.\"person\" t1 LEFT JOIN agreego.\"user\" t2 ON t2.id = t1.id LEFT JOIN agreego.\"organization\" t3 ON t3.id = t1.id LEFT JOIN agreego.\"entity\" t4 ON t4.id = t1.id WHERE \"first_name\" = 'John' AND \"last_name\" = 'Doe' AND \"date_of_birth\" = '1990-01-01T00:00:00Z' AND \"pronouns\" IS NULL",
"INSERT INTO agreego.\"entity\" (\"created_at\", \"created_by\", \"id\", \"modified_at\", \"modified_by\", \"type\") VALUES ('{{timestamp}}', '00000000-0000-0000-0000-000000000000', '{{uuid:person_1}}', '{{timestamp}}', '00000000-0000-0000-0000-000000000000', 'person')",
"INSERT INTO agreego.\"organization\" (\"id\", \"type\") VALUES ('{{uuid:person_1}}', 'person')",
"INSERT INTO agreego.\"user\" (\"id\", \"type\") VALUES ('{{uuid:person_1}}', 'person')",
"INSERT INTO agreego.\"person\" (\"date_of_birth\", \"first_name\", \"id\", \"last_name\", \"type\") VALUES ('1990-01-01T00:00:00Z', 'John', '{{uuid:person_1}}', 'Doe', 'person')",
"INSERT INTO agreego.change (changes, entity_id, id, kind, modified_at, modified_by) VALUES ('{\"date_of_birth\":\"1990-01-01T00:00:00Z\",\"first_name\":\"John\",\"last_name\":\"Doe\",\"type\":\"person\"}', '{{uuid:person_1}}', '{{uuid}}', 'create', '{{timestamp}}', '00000000-0000-0000-0000-000000000000')",
"SELECT pg_notify('entity', '{\"complete\":{\"created_at\":\"{{timestamp}}\",\"created_by\":\"00000000-0000-0000-0000-000000000000\",\"date_of_birth\":\"1990-01-01T00:00:00Z\",\"first_name\":\"John\",\"id\":\"{{uuid:person_1}}\",\"last_name\":\"Doe\",\"modified_at\":\"{{timestamp}}\",\"modified_by\":\"00000000-0000-0000-0000-000000000000\",\"type\":\"person\"}}')"
[
"SELECT to_jsonb(t1.*) || to_jsonb(t2.*) || to_jsonb(t3.*) || to_jsonb(t4.*)",
"FROM agreego.\"person\" t1",
"LEFT JOIN agreego.\"user\" t2 ON t2.id = t1.id",
"LEFT JOIN agreego.\"organization\" t3 ON t3.id = t1.id",
"LEFT JOIN agreego.\"entity\" t4 ON t4.id = t1.id",
"WHERE",
" \"first_name\" = 'John'",
" AND \"last_name\" = 'Doe'",
" AND \"date_of_birth\" = '1990-01-01T00:00:00Z'",
" AND \"pronouns\" IS NULL"
],
[
"INSERT INTO agreego.\"entity\" (",
" \"created_at\",",
" \"created_by\",",
" \"id\",",
" \"modified_at\",",
" \"modified_by\",",
" \"type\")",
"VALUES (",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000',",
" '{{uuid:person_1}}',",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000',",
" 'person'",
")"
],
[
"INSERT INTO agreego.\"organization\" (",
" \"id\",",
" \"type\"",
")",
"VALUES (",
" '{{uuid:person_1}}',",
" 'person'",
")"
],
[
"INSERT INTO agreego.\"user\" (",
" \"id\",",
" \"type\"",
")",
"VALUES (",
" '{{uuid:person_1}}',",
" 'person'",
")"
],
[
"INSERT INTO agreego.\"person\" (",
" \"date_of_birth\",",
" \"first_name\",",
" \"id\",",
" \"last_name\",",
" \"type\"",
")",
"VALUES (",
" '1990-01-01T00:00:00Z',",
" 'John',",
" '{{uuid:person_1}}',",
" 'Doe',",
" 'person'",
")"
],
[
"INSERT INTO agreego.change (",
" changes,",
" entity_id,",
" id,",
" kind,",
" modified_at,",
" modified_by",
")",
"VALUES (",
" '{ ",
" \"date_of_birth\":\"1990-01-01T00:00:00Z\",",
" \"first_name\":\"John\",",
" \"last_name\":\"Doe\",",
" \"type\":\"person\" ",
" }',",
" '{{uuid}}',",
" 'create',",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000'",
")"
],
[
"SELECT pg_notify('entity', '{",
" \"complete\":{",
" \"created_at\":\"{{timestamp}}\",",
" \"created_by\":\"00000000-0000-0000-0000-000000000000\",",
" \"date_of_birth\":\"1990-01-01T00:00:00Z\",",
" \"first_name\":\"John\",",
" \"id\":\"{{uuid:person_1}}\",",
" \"last_name\":\"Doe\",",
" \"modified_at\":\"{{timestamp}}\",",
" \"modified_by\":\"00000000-0000-0000-0000-000000000000\",",
" \"type\":\"person\"",
" }",
"}')"
]
]
}
},
@ -466,13 +644,110 @@
"expect": {
"success": true,
"sql": [
"SELECT to_jsonb(t1.*) || to_jsonb(t2.*) || to_jsonb(t3.*) || to_jsonb(t4.*) FROM agreego.\"person\" t1 LEFT JOIN agreego.\"user\" t2 ON t2.id = t1.id LEFT JOIN agreego.\"organization\" t3 ON t3.id = t1.id LEFT JOIN agreego.\"entity\" t4 ON t4.id = t1.id WHERE t1.id = '123'",
"INSERT INTO agreego.\"entity\" (\"created_at\", \"created_by\", \"id\", \"modified_at\", \"modified_by\", \"type\") VALUES ('{{timestamp}}', '00000000-0000-0000-0000-000000000000', '123', '{{timestamp}}', '00000000-0000-0000-0000-000000000000', 'person')",
"INSERT INTO agreego.\"organization\" (\"id\", \"type\") VALUES ('123', 'person')",
"INSERT INTO agreego.\"user\" (\"id\", \"type\") VALUES ('123', 'person')",
"INSERT INTO agreego.\"person\" (\"date_of_birth\", \"first_name\", \"id\", \"last_name\", \"pronouns\", \"type\") VALUES ('1990-01-01T00:00:00Z', 'John', '123', 'Doe', NULL, 'person')",
"INSERT INTO agreego.change (changes, entity_id, id, kind, modified_at, modified_by) VALUES ('{\"date_of_birth\":\"1990-01-01T00:00:00Z\",\"first_name\":\"John\",\"last_name\":\"Doe\",\"pronouns\":\"\",\"type\":\"person\"}', '123', '{{uuid}}', 'create', '{{timestamp}}', '00000000-0000-0000-0000-000000000000')",
"SELECT pg_notify('entity', '{\"complete\":{\"created_at\":\"{{timestamp}}\",\"created_by\":\"00000000-0000-0000-0000-000000000000\",\"date_of_birth\":\"1990-01-01T00:00:00Z\",\"first_name\":\"John\",\"id\":\"123\",\"last_name\":\"Doe\",\"modified_at\":\"{{timestamp}}\",\"modified_by\":\"00000000-0000-0000-0000-000000000000\",\"pronouns\":\"\",\"type\":\"person\"}}')"
[
"SELECT to_jsonb(t1.*) || to_jsonb(t2.*) || to_jsonb(t3.*) || to_jsonb(t4.*)",
"FROM agreego.\"person\" t1",
"LEFT JOIN agreego.\"user\" t2 ON t2.id = t1.id",
"LEFT JOIN agreego.\"organization\" t3 ON t3.id = t1.id",
"LEFT JOIN agreego.\"entity\" t4 ON t4.id = t1.id",
"WHERE t1.id = '123'"
],
[
"INSERT INTO agreego.\"entity\" (",
" \"created_at\",",
" \"created_by\",",
" \"id\",",
" \"modified_at\",",
" \"modified_by\",",
" \"type\"",
")",
"VALUES (",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000',",
" '123',",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000',",
" 'person'",
")"
],
[
"INSERT INTO agreego.\"organization\" (",
" \"id\",",
" \"type\"",
")",
"VALUES (",
" '123',",
" 'person'",
")"
],
[
"INSERT INTO agreego.\"user\" (",
" \"id\",",
" \"type\"",
")",
"VALUES (",
" '123',",
" 'person'",
")"
],
[
"INSERT INTO agreego.\"person\" (",
" \"date_of_birth\",",
" \"first_name\",",
" \"id\",",
" \"last_name\",",
" \"pronouns\",",
" \"type\"",
")",
"VALUES (",
" '1990-01-01T00:00:00Z',",
" 'John',",
" '123',",
" 'Doe',",
" NULL,",
" 'person'",
")"
],
[
"INSERT INTO agreego.change (",
" changes,",
" entity_id,",
" id,",
" kind,",
" modified_at,",
" modified_by",
")",
"VALUES (",
" '{",
" \"date_of_birth\":\"1990-01-01T00:00:00Z\",",
" \"first_name\":\"John\",",
" \"last_name\":\"Doe\",",
" \"pronouns\":\"\",",
" \"type\":\"person\"",
" }',",
" '123',",
" '{{uuid}}',",
" 'create',",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000'",
")"
],
[
"SELECT pg_notify('entity', '{",
" \"complete\":{",
" \"created_at\":\"{{timestamp}}\",",
" \"created_by\":\"00000000-0000-0000-0000-000000000000\",",
" \"date_of_birth\":\"1990-01-01T00:00:00Z\",",
" \"first_name\":\"John\",",
" \"id\":\"123\",",
" \"last_name\":\"Doe\",",
" \"modified_at\":\"{{timestamp}}\",",
" \"modified_by\":\"00000000-0000-0000-0000-000000000000\",",
" \"pronouns\":\"\",",
" \"type\":\"person\"",
" }",
"}')"
]
]
}
},
@ -492,18 +767,180 @@
"expect": {
"success": true,
"sql": [
"SELECT to_jsonb(t1.*) || to_jsonb(t2.*) FROM agreego.\"order\" t1 LEFT JOIN agreego.\"entity\" t2 ON t2.id = t1.id WHERE \"id\" IS NULL",
"SELECT to_jsonb(t1.*) || to_jsonb(t2.*) || to_jsonb(t3.*) || to_jsonb(t4.*) FROM agreego.\"person\" t1 LEFT JOIN agreego.\"user\" t2 ON t2.id = t1.id LEFT JOIN agreego.\"organization\" t3 ON t3.id = t1.id LEFT JOIN agreego.\"entity\" t4 ON t4.id = t1.id WHERE \"first_name\" = 'Bob' AND \"last_name\" = 'Smith' AND \"date_of_birth\" = '2000-01-01' AND \"pronouns\" IS NULL",
"INSERT INTO agreego.\"entity\" (\"created_at\", \"created_by\", \"id\", \"modified_at\", \"modified_by\", \"type\") VALUES ('{{timestamp}}', '00000000-0000-0000-0000-000000000000', '{{uuid:customer_id}}', '{{timestamp}}', '00000000-0000-0000-0000-000000000000', 'person')",
"INSERT INTO agreego.\"organization\" (\"id\", \"type\") VALUES ('{{uuid:customer_id}}', 'person')",
"INSERT INTO agreego.\"user\" (\"id\", \"type\") VALUES ('{{uuid:customer_id}}', 'person')",
"INSERT INTO agreego.\"person\" (\"date_of_birth\", \"first_name\", \"id\", \"last_name\", \"type\") VALUES ('2000-01-01', 'Bob', '{{uuid:customer_id}}', 'Smith', 'person')",
"INSERT INTO agreego.change (changes, entity_id, id, kind, modified_at, modified_by) VALUES ('{\"date_of_birth\":\"2000-01-01\",\"first_name\":\"Bob\",\"last_name\":\"Smith\",\"type\":\"person\"}', '{{uuid:customer_id}}', '{{uuid}}', 'create', '{{timestamp}}', '00000000-0000-0000-0000-000000000000')",
"SELECT pg_notify('entity', '{\"complete\":{\"created_at\":\"{{timestamp}}\",\"created_by\":\"00000000-0000-0000-0000-000000000000\",\"date_of_birth\":\"2000-01-01\",\"first_name\":\"Bob\",\"id\":\"{{uuid:customer_id}}\",\"last_name\":\"Smith\",\"modified_at\":\"{{timestamp}}\",\"modified_by\":\"00000000-0000-0000-0000-000000000000\",\"type\":\"person\"}}')",
"INSERT INTO agreego.\"entity\" (\"created_at\", \"created_by\", \"id\", \"modified_at\", \"modified_by\", \"type\") VALUES ('{{timestamp}}', '00000000-0000-0000-0000-000000000000', '{{uuid:order_id}}', '{{timestamp}}', '00000000-0000-0000-0000-000000000000', 'order')",
"INSERT INTO agreego.\"order\" (\"customer_id\", \"id\", \"total\", \"type\") VALUES ('{{uuid:customer_id}}', '{{uuid:order_id}}', 100, 'order')",
"INSERT INTO agreego.change (changes, entity_id, id, kind, modified_at, modified_by) VALUES ('{\"customer_id\":\"{{uuid:customer_id}}\",\"total\":100.0,\"type\":\"order\"}', '{{uuid:order_id}}', '{{uuid}}', 'create', '{{timestamp}}', '00000000-0000-0000-0000-000000000000')",
"SELECT pg_notify('entity', '{\"complete\":{\"created_at\":\"{{timestamp}}\",\"created_by\":\"00000000-0000-0000-0000-000000000000\",\"customer_id\":\"{{uuid:customer_id}}\",\"id\":\"{{uuid:order_id}}\",\"modified_at\":\"{{timestamp}}\",\"modified_by\":\"00000000-0000-0000-0000-000000000000\",\"total\":100.0,\"type\":\"order\"}}')"
[
"SELECT to_jsonb(t1.*) || to_jsonb(t2.*)",
"FROM agreego.\"order\" t1",
"LEFT JOIN agreego.\"entity\" t2 ON t2.id = t1.id",
"WHERE \"id\" IS NULL"
],
[
"SELECT to_jsonb(t1.*) || to_jsonb(t2.*) || to_jsonb(t3.*) || to_jsonb(t4.*)",
"FROM agreego.\"person\" t1",
"LEFT JOIN agreego.\"user\" t2 ON t2.id = t1.id",
"LEFT JOIN agreego.\"organization\" t3 ON t3.id = t1.id",
"LEFT JOIN agreego.\"entity\" t4 ON t4.id = t1.id",
"WHERE",
" \"first_name\" = 'Bob'",
" AND \"last_name\" = 'Smith'",
" AND \"date_of_birth\" = '2000-01-01'",
" AND \"pronouns\" IS NULL"
],
[
"INSERT INTO agreego.\"entity\" (",
" \"created_at\",",
" \"created_by\",",
" \"id\",",
" \"modified_at\",",
" \"modified_by\",",
" \"type\"",
")",
"VALUES (",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000',",
" '{{uuid:customer_id}}',",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000',",
" 'person'",
")"
],
[
"INSERT INTO agreego.\"organization\" (",
" \"id\",",
" \"type\"",
")",
"VALUES (",
" '{{uuid:customer_id}}',",
" 'person'",
")"
],
[
"INSERT INTO agreego.\"user\" (",
" \"id\",",
" \"type\"",
")",
"VALUES (",
" '{{uuid:customer_id}}',",
" 'person'",
")"
],
[
"INSERT INTO agreego.\"person\" (",
" \"date_of_birth\",",
" \"first_name\",",
" \"id\",",
" \"last_name\",",
" \"type\"",
")",
"VALUES (",
" '2000-01-01',",
" 'Bob',",
" '{{uuid:customer_id}}',",
" 'Smith',",
" 'person'",
")"
],
[
"INSERT INTO agreego.change (",
" changes,",
" entity_id,",
" id,",
" kind,",
" modified_at,",
" modified_by",
")",
"VALUES (",
" '{",
" \"date_of_birth\":\"2000-01-01\",",
" \"first_name\":\"Bob\",",
" \"last_name\":\"Smith\",",
" \"type\":\"person\"",
" }',",
" '{{uuid:customer_id}}',",
" '{{uuid}}',",
" 'create',",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000'",
")"
],
[
"SELECT pg_notify('entity', '{",
" \"complete\":{",
" \"created_at\":\"{{timestamp}}\",",
" \"created_by\":\"00000000-0000-0000-0000-000000000000\",",
" \"date_of_birth\":\"2000-01-01\",",
" \"first_name\":\"Bob\",",
" \"id\":\"{{uuid:customer_id}}\",",
" \"last_name\":\"Smith\",",
" \"modified_at\":\"{{timestamp}}\",",
" \"modified_by\":\"00000000-0000-0000-0000-000000000000\",",
" \"type\":\"person\"",
" }",
"}')"
],
[
"INSERT INTO agreego.\"entity\" (",
" \"created_at\",",
" \"created_by\",",
" \"id\",",
" \"modified_at\",",
" \"modified_by\",",
" \"type\"",
")",
"VALUES (",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000',",
" '{{uuid:order_id}}',",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000',",
" 'order'",
")"
],
[
"INSERT INTO agreego.\"order\" (",
" \"customer_id\",",
" \"id\",",
" \"total\",",
" \"type\"",
")",
"VALUES (",
" '{{uuid:customer_id}}',",
" '{{uuid:order_id}}',",
" 100,",
" 'order'",
")"
],
[
"INSERT INTO agreego.change (",
" changes,",
" entity_id,",
" id,",
" kind,",
" modified_at,",
" modified_by",
")",
"VALUES (",
" '{\"customer_id\":\"{{uuid:customer_id}}\",\"total\":100.0,\"type\":\"order\"}',",
" '{{uuid:order_id}}',",
" '{{uuid}}',",
" 'create',",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000'",
")"
],
[
"SELECT pg_notify('entity', '{",
" \"complete\":{",
" \"created_at\":\"{{timestamp}}\",",
" \"created_by\":\"00000000-0000-0000-0000-000000000000\",",
" \"customer_id\":\"{{uuid:customer_id}}\",",
" \"id\":\"{{uuid:order_id}}\",",
" \"modified_at\":\"{{timestamp}}\",",
" \"modified_by\":\"00000000-0000-0000-0000-000000000000\",",
" \"total\":100.0,",
" \"type\":\"order\"",
" }",
"}')"
]
]
}
},
@ -525,15 +962,142 @@
"expect": {
"success": true,
"sql": [
"SELECT to_jsonb(t1.*) || to_jsonb(t2.*) FROM agreego.\"order\" t1 LEFT JOIN agreego.\"entity\" t2 ON t2.id = t1.id WHERE t1.id = 'abc'",
"INSERT INTO agreego.\"entity\" (\"created_at\", \"created_by\", \"id\", \"modified_at\", \"modified_by\", \"type\") VALUES ('{{timestamp}}', '00000000-0000-0000-0000-000000000000', 'abc', '{{timestamp}}', '00000000-0000-0000-0000-000000000000', 'order')",
"INSERT INTO agreego.\"order\" (\"id\", \"total\", \"type\") VALUES ('abc', 99, 'order')",
"INSERT INTO agreego.\"entity\" (\"created_at\", \"created_by\", \"id\", \"modified_at\", \"modified_by\", \"type\") VALUES ('{{timestamp}}', '00000000-0000-0000-0000-000000000000', '{{uuid:line_id}}', '{{timestamp}}', '00000000-0000-0000-0000-000000000000', 'order_line')",
"INSERT INTO agreego.\"order_line\" (\"id\", \"order_id\", \"price\", \"product\", \"type\") VALUES ('{{uuid:line_id}}', 'abc', 99, 'Widget', 'order_line')",
"INSERT INTO agreego.change (changes, entity_id, id, kind, modified_at, modified_by) VALUES ('{\"order_id\":\"abc\",\"price\":99.0,\"product\":\"Widget\",\"type\":\"order_line\"}', '{{uuid:line_id}}', '{{uuid}}', 'create', '{{timestamp}}', '00000000-0000-0000-0000-000000000000')",
"SELECT pg_notify('entity', '{\"complete\":{\"created_at\":\"{{timestamp}}\",\"created_by\":\"00000000-0000-0000-0000-000000000000\",\"id\":\"{{uuid:line_id}}\",\"modified_at\":\"{{timestamp}}\",\"modified_by\":\"00000000-0000-0000-0000-000000000000\",\"order_id\":\"abc\",\"price\":99.0,\"product\":\"Widget\",\"type\":\"order_line\"}}')",
"INSERT INTO agreego.change (changes, entity_id, id, kind, modified_at, modified_by) VALUES ('{\"total\":99.0,\"type\":\"order\"}', 'abc', '{{uuid}}', 'create', '{{timestamp}}', '00000000-0000-0000-0000-000000000000')",
"SELECT pg_notify('entity', '{\"complete\":{\"created_at\":\"{{timestamp}}\",\"created_by\":\"00000000-0000-0000-0000-000000000000\",\"id\":\"abc\",\"modified_at\":\"{{timestamp}}\",\"modified_by\":\"00000000-0000-0000-0000-000000000000\",\"total\":99.0,\"type\":\"order\"}}')"
[
"SELECT to_jsonb(t1.*) || to_jsonb(t2.*)",
"FROM agreego.\"order\" t1",
"LEFT JOIN agreego.\"entity\" t2 ON t2.id = t1.id",
"WHERE t1.id = 'abc'"
],
[
"INSERT INTO agreego.\"entity\" (",
" \"created_at\",",
" \"created_by\",",
" \"id\",",
" \"modified_at\",",
" \"modified_by\",",
" \"type\"",
")",
"VALUES (",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000',",
" 'abc',",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000',",
" 'order'",
")"
],
[
"INSERT INTO agreego.\"order\" (",
" \"id\",",
" \"total\",",
" \"type\"",
")",
"VALUES (",
" 'abc',",
" 99,",
" 'order'",
")"
],
[
"INSERT INTO agreego.\"entity\" (",
" \"created_at\",",
" \"created_by\",",
" \"id\",",
" \"modified_at\",",
" \"modified_by\",",
" \"type\"",
")",
"VALUES (",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000',",
" '{{uuid:line_id}}',",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000',",
" 'order_line'",
")"
],
[
"INSERT INTO agreego.\"order_line\" (",
" \"id\",",
" \"order_id\",",
" \"price\",",
" \"product\",",
" \"type\")",
"VALUES (",
" '{{uuid:line_id}}',",
" 'abc',",
" 99,",
" 'Widget',",
" 'order_line'",
")"
],
[
"INSERT INTO agreego.change (",
" changes,",
" entity_id,",
" id,",
" kind,",
" modified_at,",
" modified_by",
")",
"VALUES (",
" '{",
" \"order_id\":\"abc\",",
" \"price\":99.0,",
" \"product\":\"Widget\",",
" \"type\":\"order_line\"",
" }',",
" '{{uuid:line_id}}',",
" '{{uuid}}',",
" 'create',",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000'",
")"
],
[
"SELECT pg_notify('entity', '{",
" \"complete\":{",
" \"created_at\":\"{{timestamp}}\",",
" \"created_by\":\"00000000-0000-0000-0000-000000000000\",",
" \"id\":\"{{uuid:line_id}}\",",
" \"modified_at\":\"{{timestamp}}\",",
" \"modified_by\":\"00000000-0000-0000-0000-000000000000\",",
" \"order_id\":\"abc\",",
" \"price\":99.0,\",",
" \"product\":\"Widget\",",
" \"type\":\"order_line\"",
" }",
"}')"
],
[
"INSERT INTO agreego.change (",
" changes,",
" entity_id,",
" id,",
" kind,",
" modified_at,",
" modified_by",
")",
"VALUES (",
" '{\"total\":99.0,\"type\":\"order\"}',",
" 'abc',",
" '{{uuid}}',",
" 'create',",
" '{{timestamp}}',",
" '00000000-0000-0000-0000-000000000000'",
")"
],
[
"SELECT pg_notify('entity', '{",
" \"complete\":{",
" \"created_at\":\"{{timestamp}}\",",
" \"created_by\":\"00000000-0000-0000-0000-000000000000\",",
" \"id\":\"abc\",",
" \"modified_at\":\"{{timestamp}}\",",
" \"modified_by\":\"00000000-0000-0000-0000-000000000000\",",
" \"total\":99.0,",
" \"type\":\"order\"}}')"
]
]
}
}