ash v1.27.0 API Reference
Modules
Types and simple helpers for Ash
An Api allows you to interact with your resources, and holds non-resource-specific configuration.
A small DSL for declaring APIs
Represents a resource in an API
Ensures that all resources for a given api are compiled.
Validates that join_attributes
on many to many relationships exist on the join resource
Ensures that all related resources are included in an API.
Validates that all relationships point to valid fields
The interface for an ash authorizer
The behaviour for a calculation module
Changesets are used to create and update data in Ash.
The interface for being an ash data layer.
An ETS (Erlang Term Storage) backed Ash Datalayer, for testing.
An Mnesia backed Ash Datalayer.
A data layer that simply returns structs
Declares a DSL entity.
An extension to the Ash DSL.
Declares a DSL section.
A transformer manipulates and/or validates the entire DSL state of a resource.
The Ash engine handles the parallelization/running of requests to Ash.
Represents an individual request to be processed by the engine.
Represents an unresolved field to be resolved by the engine
Used when an invalid value is provided for an action argument
Used when an invalid value is provided for an attribute change
Used when a change is provided that covers multiple attributes/relationships
Used when an invalid value is provided for a relationship change
Used when a change is provided for an attribute that does not exist
Used when a change is provided for an relationship that does not exist
Used when an attrbute or relationship is required
Used when a change fails for an unknown reason
Used when a DSL is incorrectly configured.
Used when authorization for an action fails
Used when unreachable code/conditions are reached in the framework
Used when an unknown/generic framework error occurs
Used when unreachable code/conditions are reached in the framework
Used when the sycnrhonous engine cannot proceed
The top level invalid error
Used when multiple requests with the same path are passed to the internal engine
Used when a request expresses a dependency on another request that doesn't exist
Used when an invalid primary key is given to an Api's get
Used when no limit is provided, pagination is required, and no default page size is configured
Used when multiple requests with the same path are passed to the internal engine
Used when an action name is provided that doesn't exist
Used when an action name is provided that doesn't exist
Used when a resource or alias is provided that doesn't exist
Used when page: false
is provided but pagination is required
Used when the data_layer does not support aggregates, or filtering/sorting them
Used when an invalid value is provided for a filter
Used when an invalid limit is provided
Used when an invalid load is provided
Used when an invalid offset is provided
Used when an invalid sort order is provided
Used when a resource would be read but has no read action
Used when an attribute that doesn't exist is used in a query
Used when a key in a filter contains something that is neither an attribute or a relationship
Used when a filter predicate that does not exist is referenced
Used when an relationship that doesn't exist is used in a query
Used when an entity that not exist is referenced
Used when a relationship is filtered and the destination does not have a default read action
Used when attempting to sort on a field that cannot be used for sorting
Used when the data_layer does not support a provided predicate
Used when an invalid query is provided in a side load
Used when attempting to side load a relationship that does not exist
A placeholder for a stacktrace so that we can avoid printing it everywhere
The top level unknown error container
The representation of a filter in Ash.
Represents a predicate which can be simplified and/or compared with other predicates
Checks a record to see if it matches a filter statement.
Represents a simplified filter, with a simple list of predicates
A negated predicate
Used when an aggregate or relationship hasn't been loaded.
A notifier is an extension that receives various events
Represents a notification that will be handled by a resource's notifiers
A pubsub notifier extension
Represents an individual publication setup
A page of results from keyset
based pagination.
A page of results from offset
based pagination.
Utilties around constructing/manipulating ash queries.
Represents an aggregated association value
Represents a calculated attribute requested on a query
Represents a boolean expression
A function is a predicate with an arguments list.
true if the provided field is nil
Represents the negation of the contained expression
An operator is a predicate with a left
and a right
left == right
left > right
left >= right
left in [1, 2, 3]
left is_nil true/false
left < right
left <= right
left != right
Represents a relation/attribute reference
A resource is a static definition of an entity in your system.
Represents an argument to an action
Represents a create action on a resource.
Represents a destroy action on a resource.
Represents a read action on a resource.
Represents the pagination configuration of a read action
Represents a update action on a resource.
Represents a named aggregate on the resource that can be loaded
Represents an attribute on a resource
Represents a named calculation on a resource
An argument to a calculation
Built in calculations that are automatically imported in the calculations section
The behaviour for an action-specific resource change.
Built in changes that are available to all resources
The built in resource DSL. The core DSL components of a resource are
Represents a unique constraint on a resource
Represents a belongs_to relationship on a resource
Represents a has_many relationship on a resource
Represents a has_one relationship on a resource
Represents a many_to_many relationship on a resource
Creates the attribute for belongs_to relationships that have define_field?: true
Sets the default source_field
for belongs_to attributes
Validates and caches the primary key of a resource
Ensures that countable paginated actions do not exist for resources that are not countable
Creates an automatically named has_many
relationship for each many_to_many.
Creates/validates the primary action configuration
Sets the source
key on relationships to be the resource they were defined on
Confirms that all action types declared on a resource are supported by its data layer
Ensures that the multitenancy configuration is valid for the given resource
Represents a validation in Ash.
Built in validations that are available to all resources
This behaviour is a superset of the Ecto.Type behavior, that also contains api level information, like what kinds of filters are allowed. Eventually, this may be used for composite types or serialization.
Stores an atom as a string in the database
Represents a binary.
Represents a boolean.
Represents a date in the database
Represents a simple integer
Represents a map stored in the database.
Stores a string in the database
Represents a raw elixir term in the database
Represents a UUID.
Represents a utc datetime
Represents a utc datetime with microsecond precision.
Mix Tasks
Generates a .formatter.exs from a list of extensions, and writes it.