API Reference ash v1.47.12

Modules

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.

Ensures that all function names added to the API will be unique.

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.

Tools for introspecting managed relationships.

Represents a case insensitive string

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

Validates that a resource using the simple data layer has no relationships or aggregates

The primary entry point for adding a DSL to a module.

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

Tools and utilities used by Ash to manage and conform errors

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.

Tooling for creating an Ash exception

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 an invalid query is provided in a load

Used when attempting to load a relationship that does not exist

Used when the data_layer does not support aggregates, or filtering/sorting them

Used when the data_layer does not support calculations, or filtering/sorting them

Used when an invalid value is provided for an action argument

Used when an invalid expression is used in a filter

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

A generic error that can be used to add an error to a query for a specific field

Used when an invalid sort order is provided

Due to the filter-based implementation of keyset pagination, it cannot be used with sorts on calculations.

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 function that doesn't exist is used in a query

Used when an operator that doesn't exist is used in a query

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 an actor is referenced in a filter template, but no actor exists

Used when a filter or argument is required in a query

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

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

Helpers for building filter templates

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

Helpers for working with nimble options

Types for Ash pages

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 boolean expression

Represents a calculated attribute requested on a query

Represents a function call/AST node in an Ash query expression

A function is a predicate with an arguments list.

Subtracts the given interval from the current time in UTC.

Returns true if the first string contains the second.

If predicate is truthy, then the second argument is returned, otherwise the third.

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 in [1, 2, 3]

left is_nil true/false

left != right

Represents a relation/attribute reference

Type casting logic to be used with operator/function inputs

A resource is a static definition of an entity in your system.

Types for Ash actions

Represents an argument to an action

Represents a create action on a resource.

Represents a destroy action on a resource.

Represents metadata from an action

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

Introspection for resources

Represents a function in a resource's code interface

The behaviour for an action-specific query preparation.

Builtin query preparations

Types Ash relationships

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.

Sets the default accept for each action

Creates the default primary key if one applies.

Guesses the destination_field for has many and has one relationships unless provided

Replaces a single timestamps() attribute with inserted_at and updated_at timestamps.

Ensures that all actions have unique names.

Creates/validates the primary action configuration

Sets the source key on relationships to be the resource they were defined on

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.

A validation that fails unless the attribute does not equal a specific value

A validation that fails unless the attribute equals a specific value

Built in validations that are available to all resources

Tools for working with the satsolver that drives filter subset checking (for authorization)

Utilities and types for sorting.

Describes how to convert data to Ecto.Type and eventually into the database.

Stores an atom as a string in the database

Represents a binary.

Represents a boolean.

Stores a case insensitive string in the database

Represents a date in the database

Represents a decimal.

A type for abstracting enums into a single type.

Represents a float (floating point number)

Represents a function.

Represents a simple integer

An interval of time, primarily meant to be used in expression functions

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 binary that attempts to decode input strings as a url encoded base64 string.

Represents a utc datetime

Represents a utc datetime with microsecond precision.

Helpers for working with UUIDs

Mix Tasks

Generates a .formatter.exs from a list of extensions, and writes it.