View Source ArangoXEcto.Association.EdgeMany (ArangoX Ecto v2.0.0)

The association struct for a edge_many association.

This is only to be used by an edge's :from and :to fields. This is essentially the same as a BelongsTo association but modified to allow mupltiple related fields.

This is needed because relational databases don't have the same ability to have multiple types of relation to the same name field like graph edges.

Note that this will still only have a cardinality of one. I.e. in an edge the :from field will still only reference one other schema but can multiple different types of schemas.

The available fields are:

  • cardinality - The association cardinality, always :one
  • field - The name of the association field on the schema
  • owner - The schema where the association was defined
  • owner_key - The key on the owner schema used for the association
  • related - The schema that is associated
  • related_key - The key on the related schema used for the association
  • queryables - The real query to use for querying association
  • defaults - default fields used when building the association
  • relationship - The relationship to the specified schema, default :parent
  • on_replace - The action taken on associations when schema is replaced

Summary

Types

t()

(since 2.0.0)
@type t() :: %ArangoXEcto.Association.EdgeMany{
  cardinality: :one,
  field: atom(),
  on_cast: nil | (... -> any()),
  on_replace: atom(),
  ordered: false,
  owner: atom(),
  owner_key: atom(),
  queryables: [atom()],
  related: [atom()],
  related_key: atom(),
  relationship: :parent,
  unique: true,
  where: Keyword.t()
}