ash v0.1.3 Ash.Api.Interface behaviour View Source
The primary entry point for interacting with resources and their data.
#TODO describe - Big picture description here
Link to this section Summary
Callbacks
#TODO describe
#TODO describe
#TODO describe
#TODO describe
#TODO describe
#TODO describe
#TODO describe
#TODO describe
Refetches a record from the database
Refetches a record from the database
Refetches a record from the database, raising on error.
#TODO describe
#TODO describe
#TODO describe
#TODO describe
Link to this section Callbacks
create(resource, params)
View Sourcecreate(resource :: Ash.resource(), params :: Ash.create_params()) :: {:ok, Ash.record()} | {:error, Ash.error()}
#TODO describe
:upsert?
- If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value isfalse
.:attributes
- Changes to be applied to attribute values The default value is%{}
.:relationships
- Changes to be applied to relationship values The default value is%{}
.:verbose?
- Log engine operations (very verbose?) The default value isfalse
.
create!(resource, params)
View Sourcecreate!(resource :: Ash.resource(), params :: Ash.create_params()) :: Ash.record() | no_return()
#TODO describe
:upsert?
- If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value isfalse
.:attributes
- Changes to be applied to attribute values The default value is%{}
.:relationships
- Changes to be applied to relationship values The default value is%{}
.:verbose?
- Log engine operations (very verbose?) The default value isfalse
.
destroy(record, params)
View Sourcedestroy(record :: Ash.record(), params :: Ash.update_params()) :: :ok | {:error, Ash.error()}
#TODO describe
:verbose?
- Log engine operations (very verbose?) The default value isfalse
.
destroy!(record, params)
View Sourcedestroy!(record :: Ash.record(), params :: Ash.update_params()) :: :ok | no_return()
#TODO describe
:verbose?
- Log engine operations (very verbose?) The default value isfalse
.
get(resource, id_or_filter, params)
View Sourceget(resource :: Ash.resource(), id_or_filter :: term(), params :: Ash.params()) :: {:ok, Ash.record()} | {:error, Ash.error()}
#TODO describe
:verbose?
- Log engine operations (very verbose?) The default value isfalse
.
get!(resource, id_or_filter, params)
View Sourceget!(resource :: Ash.resource(), id_or_filter :: term(), params :: Ash.params()) :: Ash.record() | no_return()
#TODO describe
:verbose?
- Log engine operations (very verbose?) The default value isfalse
.
read(resource, params)
View Sourceread(resource :: Ash.resource(), params :: Ash.params()) :: {:ok, [Ash.resource()]} | {:error, Ash.error()}
#TODO describe
:verbose?
- Log engine operations (very verbose?) The default value isfalse
.
read!(resource, params)
View Sourceread!(resource :: Ash.resource(), params :: Ash.params()) :: [Ash.resource()] | no_return()
#TODO describe
:verbose?
- Log engine operations (very verbose?) The default value isfalse
.
reload(record)
View Sourcereload(record :: Ash.record()) :: {:ok, Ash.record()} | {:error, Ash.error()}
Refetches a record from the database
reload(record, params)
View Sourcereload(record :: Ash.record(), params :: Ash.params()) :: {:ok, Ash.record()} | {:error, Ash.error()}
Refetches a record from the database
reload!(record, params)
View Sourcereload!(record :: Ash.record(), params :: Ash.params()) :: Ash.record() | no_return()
Refetches a record from the database, raising on error.
See reload/1
.
side_load(resource, params)
View Sourceside_load(resource :: Ash.resource(), params :: Ash.params()) :: {:ok, [Ash.resource()]} | {:error, Ash.error()}
#TODO describe
:verbose?
- Log engine operations (very verbose?) The default value isfalse
.
side_load!(resource, params)
View Sourceside_load!(resource :: Ash.resource(), params :: Ash.params()) :: [Ash.resource()] | no_return()
#TODO describe
:verbose?
- Log engine operations (very verbose?) The default value isfalse
.
update(record, params)
View Sourceupdate(record :: Ash.record(), params :: Ash.update_params()) :: {:ok, Ash.record()} | {:error, Ash.error()}
#TODO describe
:attributes
- Changes to be applied to attribute values The default value is%{}
.:relationships
- Changes to be applied to relationship values The default value is%{}
.:verbose?
- Log engine operations (very verbose?) The default value isfalse
.
update!(record, params)
View Sourceupdate!(record :: Ash.record(), params :: Ash.update_params()) :: Ash.record() | no_return()
#TODO describe
:attributes
- Changes to be applied to attribute values The default value is%{}
.:relationships
- Changes to be applied to relationship values The default value is%{}
.:verbose?
- Log engine operations (very verbose?) The default value isfalse
.