type_bridge.migration.utils¶
utils
¶
Shared utilities for schema operations.
type_exists
¶
Check if a type exists in the database schema.
Uses a simple query to check if the type name is valid in the schema. If the type doesn't exist, the query will raise an error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db
|
Database
|
Database connection |
required |
type_name
|
str
|
Name of the type to check (entity, relation, or attribute) |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if type exists in schema, False otherwise |
Example
type_exists(db, "person") True type_exists(db, "nonexistent") False