fixed and tested subschema promotions for beat processing

This commit is contained in:
2026-04-14 06:09:00 -04:00
parent a53e89df52
commit 0b4607b7d4
12 changed files with 618 additions and 23 deletions

View File

@ -398,5 +398,271 @@
}
}
]
},
{
"description": "Schema Promotion Accuracy Test",
"database": {
"puncs": [],
"enums": [],
"relations": [
{
"id": "r1",
"type": "relation",
"constraint": "fk_person_email",
"source_type": "person",
"source_columns": [
"email_id"
],
"destination_type": "email_address",
"destination_columns": [
"id"
],
"prefix": "email"
},
{
"id": "r2",
"type": "relation",
"constraint": "fk_person_ad_hoc_bubble",
"source_type": "person",
"source_columns": [
"ad_hoc_bubble_id"
],
"destination_type": "some_bubble",
"destination_columns": [
"id"
],
"prefix": "ad_hoc_bubble"
},
{
"id": "r3",
"type": "relation",
"constraint": "fk_person_generic_bubble",
"source_type": "person",
"source_columns": [
"generic_bubble_id"
],
"destination_type": "some_bubble",
"destination_columns": [
"id"
],
"prefix": "generic_bubble"
},
{
"id": "r4",
"type": "relation",
"constraint": "fk_person_extended_relations",
"source_type": "contact",
"source_columns": [
"source_id"
],
"destination_type": "person",
"destination_columns": [
"id"
],
"prefix": "extended_relations"
},
{
"id": "r5",
"type": "relation",
"constraint": "fk_person_standard_relations",
"source_type": "contact",
"source_columns": [
"source_id_2"
],
"destination_type": "person",
"destination_columns": [
"id"
],
"prefix": "standard_relations"
},
{
"id": "r6",
"type": "relation",
"constraint": "fk_contact_target",
"source_type": "contact",
"source_columns": [
"target_id"
],
"destination_type": "email_address",
"destination_columns": [
"id"
],
"prefix": "target"
}
],
"types": [
{
"id": "t1",
"type": "type",
"name": "person",
"module": "core",
"source": "person",
"hierarchy": [
"person"
],
"variations": [
"person",
"student"
],
"schemas": {
"full.person": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"name": {
"type": "string"
},
"email": {
"$family": "email_address"
},
"generic_bubble": {
"type": "some_bubble"
},
"ad_hoc_bubble": {
"type": "some_bubble",
"properties": {
"extra_inline_feature": {
"type": "string"
}
}
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"standard_relations": {
"type": "array",
"items": {
"type": "contact"
}
},
"extended_relations": {
"type": "array",
"items": {
"type": "contact",
"properties": {
"target": {
"type": "email_address",
"properties": {
"extra_3rd_level": {
"type": "string"
}
}
}
}
}
}
}
},
"student.person": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"kind": {
"type": "string"
},
"school": {
"type": "string"
}
}
}
}
},
{
"id": "t2",
"type": "type",
"name": "email_address",
"module": "core",
"source": "email_address",
"hierarchy": [
"email_address"
],
"variations": [
"email_address"
],
"schemas": {
"light.email_address": {
"type": "object",
"properties": {
"address": {
"type": "string"
}
}
}
}
},
{
"id": "t3",
"type": "type",
"name": "contact",
"module": "core",
"source": "contact",
"hierarchy": [
"contact"
],
"variations": [
"contact"
],
"schemas": {
"full.contact": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
}
}
}
},
{
"id": "t4",
"type": "type",
"name": "some_bubble",
"module": "core",
"source": "some_bubble",
"hierarchy": [
"some_bubble"
],
"variations": [
"some_bubble"
],
"schemas": {
"some_bubble": {
"type": "object",
"properties": {
"bubble_prop": {
"type": "string"
}
}
}
}
}
]
},
"tests": [
{
"description": "Assert exact topological schema promotion paths",
"action": "compile",
"expect": {
"success": true,
"schemas": [
"full.contact",
"full.person",
"full.person/ad_hoc_bubble",
"full.person/extended_relations",
"full.person/extended_relations/target",
"light.email_address",
"some_bubble",
"student.person"
]
}
}
]
}
]