Schema¶
- pydantic model felis.datamodel.Schema¶
Database schema model.
This represents a database schema, which contains one or more tables.
- Parameters:
data (
Any
)- Fields:
- Validators:
check_tap_table_indexes
»all fields
check_unique_constraint_names
»all fields
check_unique_index_names
»all fields
generate_ids
»all fields
- field id_map: dict[str, Any] [Optional]¶
Map of IDs to objects.
- field tables: Sequence[Table] [Required]¶
The tables in the schema.
- field version: SchemaVersion | str | None = None¶
The version of the schema.
- validator check_tap_table_indexes » all fields¶
Check that the TAP table indexes are unique.
- Parameters:
info (
ValidationInfo
) – The validation context used to determine if the check is enabled.- Returns:
The schema being validated.
- Return type:
- validator check_unique_constraint_names » all fields¶
Check for duplicate constraint names in the schema.
- Returns:
The schema being validated.
- Return type:
- Raises:
ValueError – Raised if duplicate constraint names are found in the schema.
- Parameters:
self (
Schema
)
- validator check_unique_index_names » all fields¶
Check for duplicate index names in the schema.
- Returns:
The schema being validated.
- Return type:
- Raises:
ValueError – Raised if duplicate index names are found in the schema.
- Parameters:
self (
Schema
)
- validator check_unique_table_names » tables¶
Check that table names are unique.
- Parameters:
- Returns:
The tables if they are unique.
- Return type:
- Raises:
ValueError – Raised if table names are not unique.
- validator generate_ids » all fields¶
Generate IDs for objects that do not have them.
- model_post_init(ctx)¶
Post-initialization hook for the model.
Notes
This method is called automatically by Pydantic after the model is initialized. It is used to create the ID map for the schema.
The
ctx
argument has the typeAny
because this is the function signature in Pydantic itself.