Default
Default
In-browser search
Settings
Extension to use on the Ash.Resource that will persist events.
event_log Nested DSLs Examples event_log do
clear_records_for_replay MyApp.Events.ClearAllRecords
record_id_type :integer # (default is :uuid)
persist_actor_primary_key :user_id , MyApp.Accounts.User
persist_actor_primary_key :system_actor , MyApp.SystemActor , attribute_type : :string
end
Options Name Type Default Docs primary_key_type:integer | Ash.Type.UUIDv7:integerThe type of the primary key used by the event log resource. Valid options are :integer and :uuid_v7. Defaults to :integer. clear_records_for_replaymoduleA module with the AshEvents.ClearRecords-behaviour, that is expected to clear all records before an event replay. advisory_lock_key_generatormoduleAshEvents.AdvisoryLockKeyGenerator.DefaultA module with the AshEvents.AdvisoryLockKeyGenerator-behaviour, that is expected to generate advisory lock keys when inserting events. advisory_lock_key_defaultinteger | list(integer)2147483647The value to use when acquiring advisory locks during event inserts. Must be an integer or a list of two 32-bit integers. cloak_vaultatomThe vault module to use for encrypting and decrypting both the event data and metadata. record_id_typeany:uuidThe type of the primary key used by the system, which will be the type of the record_id-field on the events. Defaults to :uuid. public_fieldslist(atom) | :all[]A list of field names to make public, or the atom :all to make all fields public.
event_log.persist_actor_primary_key persist_actor_primary_key name , destination Store the actor's primary key in the event if an actor is set, and the actor matches the resource type. You can define an entry for each actor type.
Examples persist_actor_primary_key :user_id , MyApp.Accounts.User persist_actor_primary_key :system_actor , MyApp.SystemActor Arguments Name Type Default Docs nameatomThe name of the field to use for the actor primary_key (e.g. :user_id) destinationmoduleThe resource of the actor (e.g. MyApp.Accounts.User)
Options Name Type Default Docs allow_nil?booleantrueWhether this attribute can be nil. If false, the attribute will be required. attribute_typeany:uuidThe type of the generated attribute. See Ash.Type for more. public?booleanfalseWhether this relationship should be included in public interfaces
Introspection Target: AshEvents.EventLog.PersistActorPrimaryKey
replay_overrides Nested DSLs replay_overrides.replay_override replay_override event_resource , event_action Overrides the default event replay behavior for a specific resource action.
Nested DSLs Examples replay_overrides do
replay_override MyApp.Accounts.User , :create do
versions [ 1 ]
route_to MyApp.Accounts.User , :create_v1
end
end
Arguments Name Type Default Docs event_resourceatomThe name of the resource stored in the event, that you want to match on. event_actionatomThe name of the action stored in the event, that you want to match on.
Options Name Type Default Docs versionslist(integer)A list of event versions to match on.
replay_overrides.replay_override.route_to route_to resource , action Routes the event to a different action.
Arguments