full database extracton

This commit is contained in:
2026-04-17 05:53:44 -04:00
parent d9f4a90225
commit f58d1a32a3
3 changed files with 185 additions and 77 deletions

View File

@ -81,54 +81,114 @@ fn test_library_api() {
})
);
// 3. Validate jspg_schemas
let schemas_drop = jspg_schemas();
// 3. Validate jspg_database mapping natively!
let db_drop = jspg_database();
assert_eq!(
schemas_drop.0,
db_drop.0,
json!({
"type": "drop",
"response": {
"source_schema": {
"type": "object",
"properties": {
"type": { "type": "string" },
"name": { "type": "string" },
"target": {
"type": "target_schema",
"compiledPropertyNames": ["value"]
}
},
"required": ["name"],
"compiledPropertyNames": ["name", "target", "type"],
"compiledEdges": {
"target": {
"constraint": "fk_test_target",
"forward": true
}
"enums": {},
"puncs": {},
"relations": {
"fk_test_target": {
"constraint": "fk_test_target",
"destination_columns": ["id"],
"destination_type": "target_schema",
"prefix": "target",
"source_columns": ["target_id"],
"source_type": "source_schema"
}
},
"source_schema.filter": {
"type": "object",
"properties": {
"type": { "type": ["string.condition", "null"] },
"name": { "type": ["string.condition", "null"] },
"target": { "type": ["target_schema.filter", "null"] }
"types": {
"source_schema": {
"default_fields": [],
"field_types": null,
"fields": [],
"grouped_fields": null,
"hierarchy": ["source_schema", "entity"],
"historical": false,
"id": "",
"longevity": null,
"lookup_fields": [],
"module": "",
"name": "source_schema",
"notify": false,
"null_fields": [],
"ownable": false,
"relationship": false,
"schemas": {
"source_schema": {
"compiledEdges": {
"target": {
"constraint": "fk_test_target",
"forward": true
}
},
"compiledPropertyNames": ["name", "target", "type"],
"properties": {
"name": { "type": "string" },
"target": {
"compiledPropertyNames": ["value"],
"type": "target_schema"
},
"type": { "type": "string" }
},
"required": ["name"],
"type": "object"
},
"source_schema.filter": {
"compiledPropertyNames": ["name", "target", "type"],
"properties": {
"name": { "type": ["string.condition", "null"] },
"target": { "type": ["target_schema.filter", "null"] },
"type": { "type": ["string.condition", "null"] }
},
"type": "object"
}
},
"sensitive": false,
"source": "",
"type": "",
"variations": ["source_schema"]
},
"compiledPropertyNames": ["name", "target", "type"]
},
"target_schema": {
"type": "object",
"properties": {
"value": { "type": "number" }
},
"compiledPropertyNames": ["value"]
},
"target_schema.filter": {
"type": "object",
"properties": {
"value": { "type": ["number.condition", "null"] }
},
"compiledPropertyNames": ["value"]
"target_schema": {
"default_fields": [],
"field_types": null,
"fields": [],
"grouped_fields": null,
"hierarchy": ["target_schema", "entity"],
"historical": false,
"id": "",
"longevity": null,
"lookup_fields": [],
"module": "",
"name": "target_schema",
"notify": false,
"null_fields": [],
"ownable": false,
"relationship": false,
"schemas": {
"target_schema": {
"compiledPropertyNames": ["value"],
"properties": {
"value": { "type": "number" }
},
"type": "object"
},
"target_schema.filter": {
"compiledPropertyNames": ["value"],
"properties": {
"value": { "type": ["number.condition", "null"] }
},
"type": "object"
}
},
"sensitive": false,
"source": "",
"type": "",
"variations": ["target_schema"]
}
}
}
})