Book seed issue: Tunez.Music.Artist.read had no matching bulk strategy that could be used
When I try to run the first seed script for artists from the book code I get the following error message:
This is my Artist resource. I've tried to follow the book, but might have messed something up.
I am using the unmodified seed script from the code repo:
https://github.com/sevenseacat/tunez/blob/main/priv/repo/seeds/01-artists.exs
If I remove
strategy: :stream
from Ash.bulk_destroy!
it works.GitHub
tunez/priv/repo/seeds/01-artists.exs at main · sevenseacat/tunez
The starter application for the Ash Framework book - sevenseacat/tunez
4 Replies
As a side note, when cloning the repository and checking out the
end-of-chapter-2
branch the seed script works fine, so it looks like I might have done somthing wrong probablyAre you on the same Ash version that's also used in the tunez repo?
Looked at the code, I think it happens because you created your own read action. It seems that the default read action sets up some pagination defaults as well.
so what you would need to do to make your version work is set those options in your read action.
I think you're right! Changing it to the default
:read
solved the problem. Thanks! 🫶oooh I didn't know that default read actions did this, good to know