galchemy/orm/graph

Types

pub type HydratedEntity {
  HydratedEntity(
    entity: entity.Entity,
    relations: List(HydratedRelation),
  )
}

Constructors

pub type HydratedRelation {
  HydratedRelation(name: String, value: RelationValue)
}

Constructors

pub type HydrationError {
  EntityError(entity.EntityError)
  UnknownRelation(
    table: relation.TableRef,
    relation_name: String,
  )
}

Constructors

pub type HydrationHookError(hook_error) {
  HydrationError(HydrationError)
  HookError(hook_error)
}

Constructors

pub type RelationValue {
  ToOne(option.Option(entity.Entity))
  ToMany(List(entity.Entity))
}

Constructors

Values

pub fn hydrate(
  next_entity: entity.Entity,
  identities: identity_map.IdentityMap,
) -> Result(HydratedEntity, HydrationError)
pub fn hydrate_many(
  entities: List(entity.Entity),
  relation_names: List(String),
  identities: identity_map.IdentityMap,
) -> Result(List(HydratedEntity), HydrationError)
pub fn hydrate_many_with_hooks(
  entities: List(entity.Entity),
  relation_names: List(String),
  identities: identity_map.IdentityMap,
  hooks: hook.EntityHooks(hook_error),
) -> Result(List(HydratedEntity), HydrationHookError(hook_error))
pub fn hydrate_only(
  next_entity: entity.Entity,
  relation_names: List(String),
  identities: identity_map.IdentityMap,
) -> Result(HydratedEntity, HydrationError)
pub fn hydrate_only_with_hooks(
  next_entity: entity.Entity,
  relation_names: List(String),
  identities: identity_map.IdentityMap,
  hooks: hook.EntityHooks(hook_error),
) -> Result(HydratedEntity, HydrationHookError(hook_error))
pub fn hydrate_with_hooks(
  next_entity: entity.Entity,
  identities: identity_map.IdentityMap,
  hooks: hook.EntityHooks(hook_error),
) -> Result(HydratedEntity, HydrationHookError(hook_error))
pub fn hydrated_entity(hydrated: HydratedEntity) -> entity.Entity
pub fn relation_named(
  hydrated: HydratedEntity,
  relation_name: String,
) -> option.Option(HydratedRelation)
Search Document