swiss_schema icon indicating copy to clipboard operation
swiss_schema copied to clipboard

Should `c:insert/2`, `c:insert!/2`, `c:update/2`, and others validate changes thru changesets?

Open joeljuca opened this issue 1 year ago • 0 comments

I just noticed that most repo mutating callback functions validate structs through the schema module's respective changeset/2, which is different than what happens when Repo.insert/2 is used. I'm not sure what to do in this case.

Should it validate all changes through changeset/2 or should they dangerously allow inserts directly, without caring with changeset validations (effectively delegating it to the respective functions)?

joeljuca avatar Nov 01 '23 19:11 joeljuca