galchemy/orm/mapper_registry

Types

pub type MapperRegistry {
  MapperRegistry(mappers: List(metadata.ModelMetadata))
}

Constructors

pub type RegistryError {
  DuplicateMapper(relation.TableRef)
  UnknownMapper(relation.TableRef)
  MetadataError(metadata.MetadataError)
}

Constructors

Values

pub fn all(
  registry: MapperRegistry,
) -> List(metadata.ModelMetadata)
pub fn empty() -> MapperRegistry
pub fn from_snapshot(
  snapshot: model.SchemaSnapshot,
) -> Result(MapperRegistry, RegistryError)
pub fn get(
  registry: MapperRegistry,
  schema_name: String,
  table_name: String,
) -> Result(metadata.ModelMetadata, RegistryError)
pub fn lookup(
  registry: MapperRegistry,
  schema_name: String,
  table_name: String,
) -> option.Option(metadata.ModelMetadata)
pub fn register(
  registry: MapperRegistry,
  mapper: metadata.ModelMetadata,
) -> Result(MapperRegistry, RegistryError)
Search Document