AshNeo4j.DataLayer.Info (AshNeo4j v0.2.2)

View Source

Introspection helpers for AshNeo4j.DataLayer

Summary

Functions

Converts an attribute name to a node property name string, translating if necessary The attribute name can be an Ash.AAsh.Query.Ref or atom

Returns a node_relationship that matches the source attribute name

Returns a node_relationship that matches the edge label and direction

Returns a matching Ash.Resource.Info relationship given relationship and destination node labels

Returns the reverse node relationship given resource and relationship name

Returns the source node property name given the source resource, dest_resource and destination attribute name, i.e. post_id returns uuid

Functions

convert_to_property_name(resource, ash_query_ref)

@spec convert_to_property_name(
  Ash.Resource.t(),
  struct()
) :: String.t() | nil
@spec convert_to_property_name(Ash.Resource.t(), atom()) :: String.t() | nil

Converts an attribute name to a node property name string, translating if necessary The attribute name can be an Ash.AAsh.Query.Ref or atom

label(resource)

@spec label(Ash.Resource.t()) :: atom() | nil

node_relationship(resource, name)

@spec node_relationship(Ash.Resource.t(), atom() | String.t()) :: tuple() | nil

Returns a node_relationship that matches the source attribute name

node_relationship(resource, edge_label, direction)

@spec node_relationship(Ash.Resource.t(), atom(), atom()) :: tuple() | nil

Returns a node_relationship that matches the edge label and direction

relate(resource)

@spec relate(Ash.Resource.t()) :: [tuple()] | nil

relationship(resource, relationship_label, dest_label)

@spec relationship(Ash.Resource.t(), atom(), atom()) :: struct() | nil

Returns a matching Ash.Resource.Info relationship given relationship and destination node labels

relationship_attributes(resource)

@spec relationship_attributes(Ash.Resource.t()) :: keyword() | nil

reverse_node_relationship(resource, name)

@spec reverse_node_relationship(Ash.Resource.t(), atom()) :: [tuple()] | nil

Returns the reverse node relationship given resource and relationship name

skip(resource)

@spec skip(Ash.Resource.t()) :: list() | nil

source_node_property_name(source_resource, dest_resource, dest_attribute_name)

@spec source_node_property_name(Ash.Resource.t(), atom(), atom()) :: atom() | nil

Returns the source node property name given the source resource, dest_resource and destination attribute name, i.e. post_id returns uuid

translate(resource)

@spec translate(Ash.Resource.t()) :: keyword() | nil

translation(resource)

@spec translation(Ash.Resource.t()) :: keyword() | nil