swiss_schema
swiss_schema copied to clipboard
A Swiss Army knife for your Ecto schemas
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...
Today, SwissSchema is pinned to work with Ecto versions matching `"~> 3.10"`. However, SwissSchema should be able to work with any Ecto version over the major 3.x. It would also...
SwissSchema should load default configuration (eg: the `:repo` opt for `use SwissSchema`) from `config/config.exs`. This way, we could avoid repeating the same configuration over and over in multiple schemas and...
Currently we define: - `insert/2` - `insert!/2` - `create/2` - `create!/2` That have the exactly same logic with the additional issue that creation functions call insertion functions. So let’s deep...
I'm picking up from #22 and completing what's left. Closes #18.
## Introduction A cool feature of ecto queries and schemas is to perform cross table join that have associations between them, that way you can retrieve assoc data with simple...
I've been thinking about making SwissSchema able to generate schema functions in other modules than the target schema itself. The use case is to allow it to be used in...
This module implements functionality that's similar to what some object-oriented frameworks do: it puts the data schema definition and the data manipulation functions together. It doesn't tie data to functions,...
[Ecto.Repo's `c:insert/2`](https://hexdocs.pm/ecto/Ecto.Repo.html#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
There are multiple SwissSchema functions that perform IO calls, database accesses that, in turn, translate to file system and/or network calls. These things are often the reason of performance bottlenecks...