galchemy/orm/runtime_registry
Types
pub type RegistryError {
DuplicateModel(relation.TableRef)
UnknownModel(relation.TableRef)
MetadataError(metadata.MetadataError)
DeclarativeError(declarative.DeclarativeError)
MapperRegistryError(mapper_registry.RegistryError)
}
Constructors
-
DuplicateModel(relation.TableRef) -
UnknownModel(relation.TableRef) -
MetadataError(metadata.MetadataError) -
DeclarativeError(declarative.DeclarativeError) -
MapperRegistryError(mapper_registry.RegistryError)
pub type RuntimeModel {
RuntimeModel(
table: relation.TableRef,
table_schema: model.TableSchema,
metadata: metadata.ModelMetadata,
)
}
Constructors
-
RuntimeModel( table: relation.TableRef, table_schema: model.TableSchema, metadata: metadata.ModelMetadata, )
pub type RuntimeRegistry {
RuntimeRegistry(
snapshot: model.SchemaSnapshot,
models: List(RuntimeModel),
)
}
Constructors
-
RuntimeRegistry( snapshot: model.SchemaSnapshot, models: List(RuntimeModel), )
Values
pub fn all(registry: RuntimeRegistry) -> List(RuntimeModel)
pub fn empty() -> RuntimeRegistry
pub fn from_models(
models: List(declarative.Model),
) -> Result(RuntimeRegistry, RegistryError)
pub fn from_snapshot(
snapshot: model.SchemaSnapshot,
) -> Result(RuntimeRegistry, RegistryError)
pub fn get(
registry: RuntimeRegistry,
schema_name: String,
table_name: String,
) -> Result(RuntimeModel, RegistryError)
pub fn has_column(
registry: RuntimeRegistry,
schema_name: String,
table_name: String,
column_name: String,
) -> Result(Bool, RegistryError)
pub fn has_relation(
registry: RuntimeRegistry,
schema_name: String,
table_name: String,
relation_name: String,
) -> Result(Bool, RegistryError)
pub fn lookup(
registry: RuntimeRegistry,
schema_name: String,
table_name: String,
) -> option.Option(RuntimeModel)
pub fn model_metadata(
registry: RuntimeRegistry,
schema_name: String,
table_name: String,
) -> Result(metadata.ModelMetadata, RegistryError)
pub fn register_model(
registry: RuntimeRegistry,
next_model: declarative.Model,
) -> Result(RuntimeRegistry, RegistryError)
pub fn relation_named(
registry: RuntimeRegistry,
schema_name: String,
table_name: String,
relation_name: String,
) -> Result(option.Option(relation.Relation), RegistryError)
pub fn snapshot(
registry: RuntimeRegistry,
) -> model.SchemaSnapshot
pub fn table_schema(
registry: RuntimeRegistry,
schema_name: String,
table_name: String,
) -> Result(model.TableSchema, RegistryError)
pub fn to_mapper_registry(
registry: RuntimeRegistry,
) -> Result(mapper_registry.MapperRegistry, RegistryError)