joeljuca / swiss_schema

A Swiss Army knife for your Ecto schemas
https://hex.pm/packages/swiss_schema
Apache License 2.0
26 stars 4 forks source link

Implement `c:upsert/2` as a pre-configured version of `c:insert/2` #11

Open joeljuca opened 8 months ago

joeljuca commented 8 months ago

Ecto.Repo's c:insert/2 can be used to perform UPSERT operations (an INSERT opts that becomes UPDATE if a given entry is already present in the repository).

See: https://hexdocs.pm/ecto/Ecto.Repo.html#c:insert/2-upserts

joeljuca commented 8 months ago

I'm tagging it as good first issue so new contributors can pick it to implement and PR.

If you're reading this and would like to contribute to the project, feel free to pick it up.