News for hackers. Stuff that matters.
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by second_brekkie on Tuesday November 07, 2023 @09:56AM (#38177451)
This is a nice article. I've used Ecto embedded schemas and nimble options separately but never thought to use them together.

Faced with this kind of issue, I'd use Ash with the `Simple` data layer. You can get all the power of an embedded Ecto schema and nimble options together in a single dsl.

If you need to validate with arbitrary logic you can do that with a 'validation'

If you need to transform the input data before you return the struct you can do it in a change set.

It's all there!

There are no comments on this comment yet.