Ash.Api.create

You're seeing just the callback create, go back to Ash.Api module for more information.

Specs

create(Ash.Changeset.t(), params :: Keyword.t()) ::
  {:ok, Ash.Resource.record()} | {:error, term()}

Create a record.

  • :upsert? - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.

  • :upsert_identity - The identity to use when detecting conflicts for upsert?. By default, the primary key is used. Has no effect if upsert?: true is not provided

  • :verbose? - Log engine operations (very verbose!) The default value is false.

  • :action - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :stacktraces? - For Ash errors, wether or not each error has a stacktrace. See the error_handling guide for more. The default value is true.

  • :tenant - A tenant to set on the query or changeset

  • :actor - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :return_notifications? - Use this if you're running ash actions in your own transaction and you want notifications to happen still.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.