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

jeffmcompsci
Title: Design and Build Great Web APIs - typo “https://company-atk.herokuapp.com/2258ie4t68jv” (page 19, third bullet in URL list) Typo:...
New
yulkin
your book suggests to use Image.toByteData() to convert image to bytes, however I get the following error: "the getter ‘toByteData’ isn’t...
New
mikecargal
Title: Hands-On Rust (Chapter 11: prefab) Just played a couple of amulet-less games. With a bit of debugging, I believe that your can_p...
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
conradwt
First, the code resources: Page 237: rumbl_umbrella/apps/rumbl/mix.exs Note: That this file is missing. Page 238: rumbl_umbrella/app...
New
AleksandrKudashkin
On the page xv there is an instruction to run bin/setup from the main folder. I downloaded the source code today (12/03/21) and can’t see...
New
jskubick
I found an issue in Chapter 7 regarding android:backgroundTint vs app:backgroundTint. How to replicate: load chapter-7 from zipfile i...
New
digitalbias
Title: Build a Weather Station with Elixir and Nerves: Problem connecting to Postgres with Grafana on (page 64) If you follow the defau...
New
redconfetti
Docker-Machine became part of the Docker Toolbox, which was deprecated in 2020, long after Docker Desktop supported Docker Engine nativel...
New
dachristenson
@mfazio23 Android Studio will not accept anything I do when trying to use the Transformations class, as described on pp. 140-141. Googl...
New

Other popular topics Top

PragmaticBookshelf
Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
mafinar
Crystal recently reached version 1. I had been following it for awhile but never got to really learn it. Most languages I picked up out o...
New
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
New
New
New
PragmaticBookshelf
Develop, deploy, and debug BEAM applications using BEAMOps: a new paradigm that focuses on scalability, fault tolerance, and owning each ...
New
AnfaengerAlex
Hello, I’m a beginner in Android development and I’m facing an issue with my project setup. In my build.gradle.kts file, I have the foll...
New

Sub Categories: