Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
joeljuca opened this issue Nov 1, 2023 · 2 comments
Labels
question Further information is requested
Milestone

Comments

@joeljuca
Copy link
Owner

joeljuca commented Nov 1, 2023

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 joeljuca added the question Further information is requested label Nov 1, 2023
@joeljuca joeljuca added this to the v1.0.0 milestone May 18, 2024
@joeljuca
Copy link
Owner Author

I think it's wise to check how these functions differ in Ecto APIs (aka.: which ones validate changes w/ changesets and which do not) and replicate it in SwissSchema APIs.

Since it'll probably cause breaking changes, it's important to advertise, both in docs and social media, that a version bringing this change (probably v1.0.0) will be an API-breaking one.

@joeljuca
Copy link
Owner Author

To be continued on #20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant