View Source Ash (ash v2.17.0)

General purpose tools for working with Ash and Ash resources.

Summary

Functions

Converts a context map to opts to be passed into an action.

Gets the current actor from the process dictionary

Gets the current authorize? from the process dictionary

Gets the current context from the process dictionary

Gets all of the ash context so it can be set into a new process.

Gets the current tenant from the process dictionary

Gets the current tracer

Deep merges context into the process dictionary that is used for all changesets and queries.

Removes a tracer from the process dictionary.

Sets actor into the process dictionary that is used for all changesets and queries.

Sets authorize? into the process dictionary that is used for all changesets and queries.

Sets context into the process dictionary that is used for all changesets and queries.

Sets tenant into the process dictionary that is used for all changesets and queries.

Sets the tracer into the process dictionary that will be used to trace requests

Updates the context into the process dictionary that is used for all changesets and queries.

Functions

See Ash.Api.GlobalInterface.aggregate/2.

Link to this function

aggregate(arg1, arg2, arg3)

View Source

See Ash.Api.GlobalInterface.aggregate/3.

See Ash.Api.GlobalInterface.aggregate!/2.

Link to this function

aggregate!(arg1, arg2, arg3)

View Source

See Ash.Api.GlobalInterface.aggregate!/3.

See Ash.Api.GlobalInterface.avg/2.

See Ash.Api.GlobalInterface.avg/3.

See Ash.Api.GlobalInterface.avg!/2.

See Ash.Api.GlobalInterface.avg!/3.

Link to this function

bulk_create(arg1, arg2, arg3)

View Source

See Ash.Api.GlobalInterface.bulk_create/3.

Link to this function

bulk_create(arg1, arg2, arg3, arg4)

View Source

See Ash.Api.GlobalInterface.bulk_create/4.

Link to this function

bulk_create!(arg1, arg2, arg3)

View Source

See Ash.Api.GlobalInterface.bulk_create!/3.

Link to this function

bulk_create!(arg1, arg2, arg3, arg4)

View Source

See Ash.Api.GlobalInterface.bulk_create!/4.

See Ash.Api.GlobalInterface.calculate/2.

Link to this function

calculate(arg1, arg2, arg3)

View Source

See Ash.Api.GlobalInterface.calculate/3.

See Ash.Api.GlobalInterface.calculate!/2.

Link to this function

calculate!(arg1, arg2, arg3)

View Source

See Ash.Api.GlobalInterface.calculate!/3.

See Ash.Api.GlobalInterface.can/2.

See Ash.Api.GlobalInterface.can/3.

See Ash.Api.GlobalInterface.can?/2.

See Ash.Api.GlobalInterface.can?/3.

Link to this function

context_to_opts(map, add_to \\ [])

View Source

Converts a context map to opts to be passed into an action.

See Ash.Api.GlobalInterface.count/1.

See Ash.Api.GlobalInterface.count/2.

See Ash.Api.GlobalInterface.count!/1.

See Ash.Api.GlobalInterface.count!/2.

See Ash.Api.GlobalInterface.create/1.

See Ash.Api.GlobalInterface.create/2.

See Ash.Api.GlobalInterface.create!/1.

See Ash.Api.GlobalInterface.create!/2.

See Ash.Api.GlobalInterface.destroy/1.

See Ash.Api.GlobalInterface.destroy/2.

See Ash.Api.GlobalInterface.destroy!/1.

See Ash.Api.GlobalInterface.destroy!/2.

See Ash.Api.GlobalInterface.exists/1.

See Ash.Api.GlobalInterface.exists/2.

See Ash.Api.GlobalInterface.exists?/1.

See Ash.Api.GlobalInterface.exists?/2.

See Ash.Api.GlobalInterface.first/2.

See Ash.Api.GlobalInterface.first/3.

See Ash.Api.GlobalInterface.first!/2.

Link to this function

first!(arg1, arg2, arg3)

View Source

See Ash.Api.GlobalInterface.first!/3.

See Ash.Api.GlobalInterface.get/2.

See Ash.Api.GlobalInterface.get/3.

See Ash.Api.GlobalInterface.get!/2.

See Ash.Api.GlobalInterface.get!/3.

@spec get_actor() :: term()

Gets the current actor from the process dictionary

@spec get_authorize?() :: term()

Gets the current authorize? from the process dictionary

@spec get_context() :: term()

Gets the current context from the process dictionary

Link to this function

get_context_for_transfer(opts \\ [])

View Source
@spec get_context_for_transfer(opts :: Keyword.t()) :: term()

Gets all of the ash context so it can be set into a new process.

Use transfer_context/1 in the new process to set the context.

@spec get_tenant() :: term()

Gets the current tenant from the process dictionary

@spec get_tracer() :: term()

Gets the current tracer

See Ash.Api.GlobalInterface.list/2.

See Ash.Api.GlobalInterface.list/3.

See Ash.Api.GlobalInterface.list!/2.

See Ash.Api.GlobalInterface.list!/3.

See Ash.Api.GlobalInterface.load/2.

See Ash.Api.GlobalInterface.load/3.

See Ash.Api.GlobalInterface.load!/2.

See Ash.Api.GlobalInterface.load!/3.

See Ash.Api.GlobalInterface.max/2.

See Ash.Api.GlobalInterface.max/3.

See Ash.Api.GlobalInterface.max!/2.

See Ash.Api.GlobalInterface.max!/3.

@spec merge_context(map()) :: :ok

Deep merges context into the process dictionary that is used for all changesets and queries.

See Ash.Api.GlobalInterface.min/2.

See Ash.Api.GlobalInterface.min/3.

See Ash.Api.GlobalInterface.min!/2.

See Ash.Api.GlobalInterface.min!/3.

See Ash.Api.GlobalInterface.page/2.

See Ash.Api.GlobalInterface.read/1.

See Ash.Api.GlobalInterface.read/2.

See Ash.Api.GlobalInterface.read!/1.

See Ash.Api.GlobalInterface.read!/2.

See Ash.Api.GlobalInterface.read_one/1.

See Ash.Api.GlobalInterface.read_one/2.

See Ash.Api.GlobalInterface.read_one!/1.

See Ash.Api.GlobalInterface.read_one!/2.

See Ash.Api.GlobalInterface.reload/1.

@spec remove_tracer(module() | [module()]) :: :ok

Removes a tracer from the process dictionary.

See Ash.Api.GlobalInterface.run_action/1.

See Ash.Api.GlobalInterface.run_action/2.

See Ash.Api.GlobalInterface.run_action!/1.

See Ash.Api.GlobalInterface.run_action!/2.

@spec set_actor(map()) :: :ok

Sets actor into the process dictionary that is used for all changesets and queries.

@spec set_authorize?(map()) :: :ok

Sets authorize? into the process dictionary that is used for all changesets and queries.

@spec set_context(map()) :: :ok

Sets context into the process dictionary that is used for all changesets and queries.

In Ash 3.0, this will be updated to deep merge

@spec set_tenant(String.t()) :: :ok

Sets tenant into the process dictionary that is used for all changesets and queries.

@spec set_tracer(module() | [module()]) :: :ok

Sets the tracer into the process dictionary that will be used to trace requests

See Ash.Api.GlobalInterface.stream!/1.

See Ash.Api.GlobalInterface.stream!/2.

See Ash.Api.GlobalInterface.sum/2.

See Ash.Api.GlobalInterface.sum/3.

See Ash.Api.GlobalInterface.sum!/2.

See Ash.Api.GlobalInterface.sum!/3.

Link to this function

transfer_context(map, opts \\ [])

View Source
@spec transfer_context(term(), opts :: Keyword.t()) :: :ok

See Ash.Api.GlobalInterface.update/1.

See Ash.Api.GlobalInterface.update/2.

See Ash.Api.GlobalInterface.update!/1.

See Ash.Api.GlobalInterface.update!/2.

@spec update_context((map() -> map())) :: :ok

Updates the context into the process dictionary that is used for all changesets and queries.