Is this `seeds.exs` idiomatic Elixir?

Honestly re-reading what you’re going for I’d probably just stick with the normal seeds file. If you want to control what enviros they get applied to here is another approach (and all around a good article on seeding): https://medium.com/geekculture/phoenix-understanding-how-to-seed-data-c2be863ddd1d

1 Like

“It depends” :person_shrugging:

For a script like this, I’d at least want it to be loud, like raising an exception if something goes wrong. I likely wouldn’t do serious error handling to give the user some nice message because the audience is software developers.

4 Likes

To avoid loose ends: This code snippet doesn’t work as intended because the async stream never actually runs.

Fixed version: xlp-book-club-API/example/priv/repo/seeds.exs at main · elixirland/xlp-book-club-API · GitHub