AshNeo4j.Resource.Info (AshNeo4j v0.4.1)

Copy Markdown View Source

Resource information for AshNeo4j.DataLayer

Summary

Functions

Returns the Ash.Type of the attribute from the name

Converts attributes to node properties

Converts an attribute name to a node property name string, translating if necessary

Returns whether the relationship is exclusive on the destination resource, given a source resource and source relationship name

The domain label is the PascalCase short name of the domain's Elixir Module name. It is used only on create.

The resource label if set via the DSL, or defaulted as the PascalCase short name of the resource's Elixir Module name. It is used on all operations.

Returns the list of labels for the resource. This will consist of any domain label then resource label.

Returns a node_relationship that matches the relationship name

Returns a node_relationship that matches the edge label, edge direction and destination label

Returns the list of node relationships which block resource deletion, given the source resource The node relationships are tuples of {edge_label, edge_direction, destination_label} These include explicit guard relationships.

Returns the effective relate of the resource, merging DSL and defaults

Returns the relationship from the source attribute, if any

Returns a matching Ash.Resource.Info relationship given edge label, edge direction and destination node label

Returns the relationship attributes for the resource.

Returns the reverse node relationship given resource and relationship name

Returns the reverse relationship given resource and relationship name

Returns whether the relationship is exclusive on the source resource

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

Returns the list of attribute translations for the resource.

Functions

attribute_type(resource, ash_query_ref)

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

Returns the Ash.Type of the attribute from the name

convert_to_properties(resource, attributes)

@spec convert_to_properties(Ash.Resource.t(), map()) :: map()

Converts attributes to node properties

convert_to_property_name(resource, ash_query_ref)

@spec convert_to_property_name(Ash.Resource.t(), Ash.Query.Ref.t()) ::
  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

destination_exclusive?(resource, name)

@spec destination_exclusive?(Ash.Resource.t(), atom()) :: boolean()

Returns whether the relationship is exclusive on the destination resource, given a source resource and source relationship name

domain_label(resource)

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

The domain label is the PascalCase short name of the domain's Elixir Module name. It is used only on create.

label(resource)

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

The resource label if set via the DSL, or defaulted as the PascalCase short name of the resource's Elixir Module name. It is used on all operations.

labels(resource)

@spec labels(Ash.Resource.t()) :: [atom()] | nil

Returns the list of labels for the resource. This will consist of any domain label then resource label.

node_relationship(resource, name)

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

Returns a node_relationship that matches the relationship name

node_relationship(resource, edge_label, edge_direction, destination_label)

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

Returns a node_relationship that matches the edge label, edge direction and destination label

preserve_node_relationships(resource)

@spec preserve_node_relationships(Ash.Resource.t()) :: [tuple()]

Returns the list of node relationships which block resource deletion, given the source resource The node relationships are tuples of {edge_label, edge_direction, destination_label} These include explicit guard relationships.

relate(resource)

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

Returns the effective relate of the resource, merging DSL and defaults

relationship(resource, source_attribute)

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

Returns the relationship from the source attribute, if any

relationship(resource, edge_label, edge_direction, destination_label)

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

Returns a matching Ash.Resource.Info relationship given edge label, edge direction and destination node label

relationship_attributes(resource)

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

Returns the relationship attributes for the resource.

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

reverse_relationship(resource, name)

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

Returns the reverse relationship given resource and relationship name

source_exclusive?(resource, name)

@spec source_exclusive?(Ash.Resource.t(), atom()) :: boolean()

Returns whether the relationship is exclusive on the source resource

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

translations(resource)

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

Returns the list of attribute translations for the resource.