Hi,
Thanks for this great book!
Not sure if I missed something, if it’s even worth mentioning, or if this was even an intentional side quest to discover how awesomely descriptive errors in Ash can be, but wanted to share in case it’s useful.
After uncommenting the command to run the seed file script for albums and then running mix seed
, I got the following error:
** (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
I fixed it with the first recommendation of number 2.) and it was only a tiny obstacle, so up to you if that warrants a small note mentioning this.
Best,
Felix