ash v0.1.3 Ash.DataLayer behaviour View Source
Link to this section Summary
Link to this section Types
Link to this type
feature()
View Sourcefeature() :: :transact | :async_engine | {:filter, filter_type()} | {:filter_related, Ash.relationship_cardinality()} | :upsert
Link to this section Functions
Link to this function
can?(feature, resource)
View Sourcecan?(feature(), Ash.resource()) :: boolean()
Link to this function
create(resource, changeset)
View Sourcecreate(Ash.resource(), Ecto.Changeset.t()) :: {:ok, Ash.record()} | {:error, Ash.error()}
Link to this function
filter(query, filter, resource)
View Sourcefilter(Ash.data_layer_query(), Ash.filter(), Ash.resource()) :: {:ok, Ash.data_layer_query()} | {:error, Ash.error()}
Link to this function
limit(query, limit, resource)
View Sourcelimit(Ash.data_layer_query(), limit :: non_neg_integer(), Ash.resource()) :: {:ok, Ash.data_layer_query()} | {:error, Ash.error()}
Link to this function
offset(query, offset, resource)
View Sourceoffset(Ash.data_layer_query(), offset :: non_neg_integer(), Ash.resource()) :: {:ok, Ash.data_layer_query()} | {:error, Ash.error()}
Link to this function
resource_to_query(resource)
View Sourceresource_to_query(Ash.resource()) :: Ash.data_layer_query()
Link to this function
run_query(query, central_resource)
View Sourcerun_query(Ash.data_layer_query(), central_resource :: Ash.resource()) :: {:ok, [Ash.record()]} | {:error, Ash.error()}
Link to this function
sort(query, sort, resource)
View Sourcesort(Ash.data_layer_query(), Ash.sort(), Ash.resource()) :: {:ok, Ash.data_layer_query()} | {:error, Ash.error()}
Link to this function
update(resource, changeset)
View Sourceupdate(Ash.resource(), Ecto.Changeset.t()) :: {:ok, Ash.record()} | {:error, Ash.error()}
Link to this function
upsert(resource, changeset)
View Sourceupsert(Ash.resource(), Ecto.Changeset.t()) :: {:ok, Ash.record()} | {:error, Ash.error()}
Link to this section Callbacks
Link to this callback
can_query_async?(arg1)
View Sourcecan_query_async?(Ash.resource()) :: boolean()
Link to this callback
create(arg1, changeset)
View Sourcecreate(Ash.resource(), changeset :: Ecto.Changeset.t()) :: {:ok, Ash.resource()} | {:error, Ash.error()}
Link to this callback
custom_filters(arg1)
View Source (optional)custom_filters(Ash.resource()) :: map()
Link to this callback
destroy(record)
View Sourcedestroy(record :: Ash.record()) :: :ok | {:error, Ash.error()}
Link to this callback
filter(arg1, arg2, resource)
View Sourcefilter(Ash.data_layer_query(), Ash.filter(), resource :: Ash.resource()) :: {:ok, Ash.data_layer_query()} | {:error, Ash.error()}
Link to this callback
limit(arg1, limit, resource)
View Sourcelimit( Ash.data_layer_query(), limit :: non_neg_integer(), resource :: Ash.resource() ) :: {:ok, Ash.data_layer_query()} | {:error, Ash.error()}
Link to this callback
offset(arg1, offset, resource)
View Sourceoffset( Ash.data_layer_query(), offset :: non_neg_integer(), resource :: Ash.resource() ) :: {:ok, Ash.data_layer_query()} | {:error, Ash.error()}
Link to this callback
resource_to_query(arg1)
View Sourceresource_to_query(Ash.resource()) :: Ash.data_layer_query()
Link to this callback
run_query(arg1, arg2)
View Sourcerun_query(Ash.data_layer_query(), Ash.resource()) :: {:ok, [Ash.resource()]} | {:error, Ash.error()}
Link to this callback
sort(arg1, arg2, resource)
View Sourcesort(Ash.data_layer_query(), Ash.sort(), resource :: Ash.resource()) :: {:ok, Ash.data_layer_query()} | {:error, Ash.error()}
Link to this callback
transaction(arg1, function)
View Source (optional)transaction(Ash.resource(), (() -> term())) :: {:ok, term()} | {:error, Ash.error()}
Link to this callback
update(arg1, changeset)
View Sourceupdate(Ash.resource(), changeset :: Ecto.Changeset.t()) :: {:ok, Ash.resource()} | {:error, Ash.error()}
Link to this callback
upsert(arg1, changeset)
View Source (optional)upsert(Ash.resource(), changeset :: Ecto.Changeset.t()) :: {:ok, Ash.resource()} | {:error, Ash.error()}