Ash Framework: Chapter 1

I’m trying to reset the database and reseed… at some point shortly after the “Defining A Read Action” where you add the “primary? true”, I get the following error when trying to reseed with “mix seed”:

** (Ash.Error.Invalid) Invalid Error * Tunez.Music.Artist.read had no matching bulk strategy that could be used. Requested strategies: [:stream] Could not use `:stream`: could not stream the query Could not use `:atomic_batches`: Not in requested strategies Could not use `:atomic`: Not in requested strategies Non stream reason: Action Tunez.Music.Artist.read does not support streaming with one of [:keyset]. There are two ways to handle this. 1.) Use the `allow_stream_with` or `stream_with` options to control what strategies are allowed. 2.) Enable the respective required pagination type on the action read, for example: # allow keyset pagination keyset?: true, required?: false # allow offset pagination offset?: true, required?: false # allow both pagination offset?: true, keyset?: true, required?: false (ash 3.5.24) lib/ash/error/invalid/no_matching_bulk_strategy.ex:4: Ash.Error.Invalid.NoMatchingBulkStrategy.exception/1 (ash 3.5.24) lib/ash/actions/destroy/bulk.ex:184: Ash.Actions.Destroy.Bulk.run/6 (ash 3.5.24) lib/ash.ex:3421: Ash.bulk_destroy!/4 priv/repo/seeds/01-artists.exs:16: (file) (elixir 1.18.4) src/elixir_compiler.erl:77: :elixir_compiler.dispatch/4 (elixir 1.18.4) src/elixir_compiler.erl:52: :elixir_compiler.compile/4 (elixir 1.18.4) src/elixir_compiler.erl:39: :elixir_compiler.maybe_fast_compile/2 (elixir 1.18.4) src/elixir_lexical.erl:13: :elixir_lexical.run/3 (elixir 1.18.4) src/elixir_compiler.erl:17: :elixir_compiler.quoted/3 (elixir 1.18.4) lib/module/parallel_checker.ex:120: Module.ParallelChecker.verify/1 (elixir 1.18.4) lib/code.ex:1525: Code.require_file/2 (mix 1.18.4) lib/mix/tasks/run.ex:148: Mix.Tasks.Run.run/5 (mix 1.18.4) lib/mix/tasks/run.ex:87: Mix.Tasks.Run.run/1 (mix 1.18.4) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5 (mix 1.18.4) lib/mix/task.ex:561: Mix.Task.run_alias/6 (mix 1.18.4) lib/mix/cli.ex:107: Mix.CLI.run_task/2 /usr/bin/mix:2: (file) (elixir 1.18.4) src/elixir_compiler.erl:77: :elixir_compiler.dispatch/4 (elixir 1.18.4) src/elixir_compiler.erl:52: :elixir_compiler.compile/4 (ash 3.5.24) lib/ash.ex:3441: Ash.bulk_destroy!/4 priv/repo/seeds/01-artists.exs:16: (file) (elixir 1.18.4) lib/code.ex:1525: Code.require_file/2 (mix 1.18.4) lib/mix/tasks/run.ex:148: Mix.Tasks.Run.run/5 (mix 1.18.4) lib/mix/tasks/run.ex:87: Mix.Tasks.Run.run/1 (mix 1.18.4) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5 (mix 1.18.4) lib/mix/task.ex:561: Mix.Task.run_alias/6 (mix 1.18.4) lib/mix/cli.ex:107: Mix.CLI.run_task/2 /usr/bin/mix:2: (file) 

Any suggestions on how to get around this?

in the priv/repo/seeds/01-artists.exs file, I had to remove the strategy: :stream for the the ASH.bulk_destroy line. This will make it default to :atomic. According to the docs, Atomic bulk destroys are used when the subject of the bulk destroy is a query, which this is.