test checkpoint
This commit is contained in:
@ -1,10 +1,37 @@
|
||||
[
|
||||
{
|
||||
"description": "Basic Queryer Execution",
|
||||
"description": "Queryer Execution",
|
||||
"database": {
|
||||
"puncs": [],
|
||||
"enums": [],
|
||||
"relations": [],
|
||||
"relations": [
|
||||
{
|
||||
"type": "relation",
|
||||
"id": "00000000-0000-0000-0000-000000000001",
|
||||
"constraint": "fk_contact_person",
|
||||
"source_type": "contact",
|
||||
"source_columns": [
|
||||
"source_id"
|
||||
],
|
||||
"destination_type": "person",
|
||||
"destination_columns": [
|
||||
"id"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"id": "00000000-0000-0000-0000-000000000002",
|
||||
"constraint": "fk_contact_phone",
|
||||
"source_type": "contact",
|
||||
"source_columns": [
|
||||
"target_id"
|
||||
],
|
||||
"destination_type": "phone_number",
|
||||
"destination_columns": [
|
||||
"id"
|
||||
]
|
||||
}
|
||||
],
|
||||
"types": [
|
||||
{
|
||||
"name": "entity",
|
||||
@ -52,142 +79,6 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "Should execute a blanket SELECT query when no filters are present",
|
||||
"action": "query",
|
||||
"schema_id": "entity",
|
||||
"expect": {
|
||||
"success": true,
|
||||
"sql": [
|
||||
"(SELECT jsonb_build_object('amount', t1_obj_t1.amount, 'archived', t1_obj_t1.archived, 'created_at', t1_obj_t1.created_at, 'id', t1_obj_t1.id, 'name', t1_obj_t1.name) FROM agreego.entity t1_obj_t1 WHERE NOT t1_obj_t1.archived)"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Should execute a blanket SELECT query isolating root stems directly",
|
||||
"action": "query",
|
||||
"schema_id": "entity",
|
||||
"stem": "",
|
||||
"expect": {
|
||||
"success": true,
|
||||
"sql": [
|
||||
"(SELECT jsonb_build_object('amount', t1_obj_t1.amount, 'archived', t1_obj_t1.archived, 'created_at', t1_obj_t1.created_at, 'id', t1_obj_t1.id, 'name', t1_obj_t1.name) FROM agreego.entity t1_obj_t1 WHERE NOT t1_obj_t1.archived)"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Should bind parameters with proper casting and ILIKE for generated generic SELECT string when using some filters",
|
||||
"action": "query",
|
||||
"schema_id": "entity",
|
||||
"filters": {
|
||||
"name": "Jane%",
|
||||
"archived": false
|
||||
},
|
||||
"expect": {
|
||||
"success": true,
|
||||
"sql": [
|
||||
"(SELECT jsonb_build_object('amount', t1_obj_t1.amount, 'archived', t1_obj_t1.archived, 'created_at', t1_obj_t1.created_at, 'id', t1_obj_t1.id, 'name', t1_obj_t1.name) FROM agreego.entity t1_obj_t1 WHERE NOT t1_obj_t1.archived AND t1_obj_t1.archived = ($1#>>'{}')::boolean AND t1_obj_t1.name ILIKE $2#>>'{}')"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Should bind all parameters with proper casting for complex generic SELECT string",
|
||||
"action": "query",
|
||||
"schema_id": "entity",
|
||||
"filters": {
|
||||
"id": "123e4567-e89b-12d3-a456-426614174000",
|
||||
"name": "Jane%",
|
||||
"amount": 100,
|
||||
"created_at": "2023-01-01T00:00:00Z",
|
||||
"archived": false
|
||||
},
|
||||
"expect": {
|
||||
"success": true,
|
||||
"sql": [
|
||||
"(SELECT jsonb_build_object('amount', t1_obj_t1.amount, 'archived', t1_obj_t1.archived, 'created_at', t1_obj_t1.created_at, 'id', t1_obj_t1.id, 'name', t1_obj_t1.name) FROM agreego.entity t1_obj_t1 WHERE NOT t1_obj_t1.archived AND t1_obj_t1.amount = ($1#>>'{}')::numeric AND t1_obj_t1.archived = ($2#>>'{}')::boolean AND t1_obj_t1.created_at = ($3#>>'{}')::timestamptz AND t1_obj_t1.id = ($4#>>'{}')::uuid AND t1_obj_t1.name ILIKE $5#>>'{}')"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "Complex Nested Queryer Execution",
|
||||
"database": {
|
||||
"puncs": [],
|
||||
"enums": [],
|
||||
"relations": [
|
||||
{
|
||||
"type": "relation",
|
||||
"id": "00000000-0000-0000-0000-000000000001",
|
||||
"constraint": "fk_contact_person",
|
||||
"source_type": "contact",
|
||||
"source_columns": [
|
||||
"source_id"
|
||||
],
|
||||
"destination_type": "person",
|
||||
"destination_columns": [
|
||||
"id"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"id": "00000000-0000-0000-0000-000000000002",
|
||||
"constraint": "fk_contact_phone",
|
||||
"source_type": "contact",
|
||||
"source_columns": [
|
||||
"target_id"
|
||||
],
|
||||
"destination_type": "phone_number",
|
||||
"destination_columns": [
|
||||
"id"
|
||||
]
|
||||
}
|
||||
],
|
||||
"types": [
|
||||
{
|
||||
"name": "entity",
|
||||
"hierarchy": [
|
||||
"entity"
|
||||
],
|
||||
"fields": [
|
||||
"id",
|
||||
"type",
|
||||
"archived"
|
||||
],
|
||||
"grouped_fields": {
|
||||
"entity": [
|
||||
"id",
|
||||
"type",
|
||||
"archived"
|
||||
]
|
||||
},
|
||||
"field_types": {
|
||||
"id": "uuid",
|
||||
"type": "text",
|
||||
"archived": "boolean"
|
||||
},
|
||||
"schemas": [
|
||||
{
|
||||
"$id": "entity",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
},
|
||||
"archived": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "person",
|
||||
@ -520,6 +411,62 @@
|
||||
]
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "Should execute a blanket SELECT query when no filters are present",
|
||||
"action": "query",
|
||||
"schema_id": "entity",
|
||||
"expect": {
|
||||
"success": true,
|
||||
"sql": [
|
||||
"(SELECT jsonb_build_object('amount', t1_obj_t1.amount, 'archived', t1_obj_t1.archived, 'created_at', t1_obj_t1.created_at, 'id', t1_obj_t1.id, 'name', t1_obj_t1.name) FROM agreego.entity t1_obj_t1 WHERE NOT t1_obj_t1.archived)"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Should execute a blanket SELECT query isolating root stems directly",
|
||||
"action": "query",
|
||||
"schema_id": "entity",
|
||||
"stem": "",
|
||||
"expect": {
|
||||
"success": true,
|
||||
"sql": [
|
||||
"(SELECT jsonb_build_object('amount', t1_obj_t1.amount, 'archived', t1_obj_t1.archived, 'created_at', t1_obj_t1.created_at, 'id', t1_obj_t1.id, 'name', t1_obj_t1.name) FROM agreego.entity t1_obj_t1 WHERE NOT t1_obj_t1.archived)"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Should bind parameters with proper casting and ILIKE for generated generic SELECT string when using some filters",
|
||||
"action": "query",
|
||||
"schema_id": "entity",
|
||||
"filters": {
|
||||
"name": "Jane%",
|
||||
"archived": false
|
||||
},
|
||||
"expect": {
|
||||
"success": true,
|
||||
"sql": [
|
||||
"(SELECT jsonb_build_object('amount', t1_obj_t1.amount, 'archived', t1_obj_t1.archived, 'created_at', t1_obj_t1.created_at, 'id', t1_obj_t1.id, 'name', t1_obj_t1.name) FROM agreego.entity t1_obj_t1 WHERE NOT t1_obj_t1.archived AND t1_obj_t1.archived = ($1#>>'{}')::boolean AND t1_obj_t1.name ILIKE $2#>>'{}')"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Should bind all parameters with proper casting for complex generic SELECT string",
|
||||
"action": "query",
|
||||
"schema_id": "entity",
|
||||
"filters": {
|
||||
"id": "123e4567-e89b-12d3-a456-426614174000",
|
||||
"name": "Jane%",
|
||||
"amount": 100,
|
||||
"created_at": "2023-01-01T00:00:00Z",
|
||||
"archived": false
|
||||
},
|
||||
"expect": {
|
||||
"success": true,
|
||||
"sql": [
|
||||
"(SELECT jsonb_build_object('amount', t1_obj_t1.amount, 'archived', t1_obj_t1.archived, 'created_at', t1_obj_t1.created_at, 'id', t1_obj_t1.id, 'name', t1_obj_t1.name) FROM agreego.entity t1_obj_t1 WHERE NOT t1_obj_t1.archived AND t1_obj_t1.amount = ($1#>>'{}')::numeric AND t1_obj_t1.archived = ($2#>>'{}')::boolean AND t1_obj_t1.created_at = ($3#>>'{}')::timestamptz AND t1_obj_t1.id = ($4#>>'{}')::uuid AND t1_obj_t1.name ILIKE $5#>>'{}')"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Should execute table multi-joins on inheritance for basic schema",
|
||||
"action": "query",
|
||||
|
||||
Reference in New Issue
Block a user