SlowburnAZ

SlowburnAZ

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?

First Post!

snitz70

snitz70

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.

Where Next?

Popular Pragmatic Bookshelf topics Top

jon
Some minor things in the paper edition that says “3 2020” on the title page verso, not mentioned in the book’s errata online: p. 186 But...
New
belgoros
Following the steps described in Chapter 6 of the book, I’m stuck with running the migration as described on page 84: bundle exec sequel...
New
simonpeter
When I try the command to create a pair of migration files I get an error. user=> (create-migration "guestbook") Execution error (Ill...
New
lirux
Hi Jamis, I think there’s an issue with a test on chapter 6. I own the ebook, version P1.0 Feb. 2019. This test doesn’t pass for me: ...
New
cro
I am working on the “Your Turn” for chapter one and building out the restart button talked about on page 27. It recommends looking into ...
New
brunogirin
When trying to run tox in parallel as explained on page 151, I got the following error: tox: error: argument -p/–parallel: expected one...
New
kolossal
Hi, I need some help, I’m new to rust and was learning through your book. but I got stuck at the last stage of distribution. Whenever I t...
New
mert
AWDWR 7, page 152, page 153: Hello everyone, I’m a little bit lost on the hotwire part. I didn’t fully understand it. On page 152 @rub...
New
NaplesDave
@mfazio23 I am following along and I have gotten up to adding the data binding items. The project has built alright until I added the da...
New
redconfetti
Docker-Machine became part of the Docker Toolbox, which was deprecated in 2020, long after Docker Desktop supported Docker Engine nativel...
New

Other popular topics Top

New
PragmaticBookshelf
Andy and Dave wrote this influential, classic book to help their clients create better software and rediscover the joy of coding. Almost ...
New
PragmaticBookshelf
Ruby, Io, Prolog, Scala, Erlang, Clojure, Haskell. With Seven Languages in Seven Weeks, by Bruce A. Tate, you’ll go beyond the syntax—and...
New
DevotionGeo
I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
New
PragmaticBookshelf
Design and develop sophisticated 2D games that are as much fun to make as they are to play. From particle effects and pathfinding to soci...
New
AstonJ
Do the test and post your score :nerd_face: :keyboard: If possible, please add info such as the keyboard you’re using, the layout (Qw...
New
Help
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New
husaindevelop
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
AstonJ
This is cool! DEEPSEEK-V3 ON M4 MAC: BLAZING FAST INFERENCE ON APPLE SILICON We just witnessed something incredible: the largest open-s...
New
PragmaticBookshelf
A concise guide to MySQL 9 database administration, covering fundamental concepts, techniques, and best practices. Neil Smyth MySQL...
New

Sub Categories: