type_bridge.migration.info¶
info
¶
Schema information container for TypeDB schema management.
SchemaInfo
¶
Container for organized schema information.
Initialize SchemaInfo with empty collections.
Source code in type_bridge/migration/info.py
get_entity_by_name
¶
Get entity by type name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Entity type name |
required |
Returns:
| Type | Description |
|---|---|
type[Entity] | None
|
Entity class or None if not found |
Source code in type_bridge/migration/info.py
get_relation_by_name
¶
Get relation by type name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Relation type name |
required |
Returns:
| Type | Description |
|---|---|
type[Relation] | None
|
Relation class or None if not found |
Source code in type_bridge/migration/info.py
validate
¶
Validate schema definitions for TypeDB constraints.
Raises:
| Type | Description |
|---|---|
SchemaValidationError
|
If schema violates TypeDB constraints |
Source code in type_bridge/migration/info.py
to_typeql
¶
Generate TypeQL schema definition from collected schema information.
Base classes (with base=True) are skipped as they don't appear in TypeDB schema.
Validates the schema before generation.
Returns:
| Type | Description |
|---|---|
str
|
TypeQL schema definition string |
Raises:
| Type | Description |
|---|---|
SchemaValidationError
|
If schema validation fails |
Source code in type_bridge/migration/info.py
compare
¶
Compare this schema with another schema.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
SchemaInfo
|
Another SchemaInfo to compare against |
required |
Returns:
| Type | Description |
|---|---|
SchemaDiff
|
SchemaDiff containing all differences between the schemas |