Changelog
4.0.0
- [breaking] Removing
new_* and change_* as they stopped fitting once I added the create_*_by type functionality. You should just use your changesets.
- [breaking] Removing insert/update changeset function options and instead either default to
changeset/2 or whatever you pass to *_*_by.
- [breaking] [feature] Refactored the options for the
use(EctoInterface) calls to use keywords because we want to be able to pass in repo on a per-definintion basis. This is especially useful for multi-database applications.
- [feature] Instead of calling
use(EctoInterface.Pubsub) seperately you can now pass pubsub: Core.PubSub, tagged: :tags, and slug: :username respectively to setup those three extensions.
3.1.0
- [feature] Allow a per-configuration per-module definition for repo in addition to the default repo.
3.0.0
- [breaking] [feature] Now when you pass preloads to
create or update it will then preload after the insert/update as well.
2.3.1
- [bug] Both
change_#{singular} and new_#{singular} were incorrectly still enforcing a map() type for the value.
2.3.0
- [feature] Prior understandings of Ecto's "changeset" functions were that they took a record and a mapping of attributes. My understanding has grown since then, for example compounding changesets makes sense and also no second (or multiple) arguments. I've at least removed the restriction of it being a map for the second arugment. You can now do:
Core.Users.create_account(:pending) and it should be compatible.
2.2.1
- [fix] Relax the requirements of the optional postgrex version
2.2.0
- [feature] Improved type annotation for the create functions
- [fix] Now you can pass repository options to
paginate_ functions whereas before they were swallowed
2.1.0
- [feature] Now includes pagination functionality via
paginated_*/*, much like stream_*. This is incorporated into the library by copying the Paginator code. I wanted to just use the library as normal but it's kinda outdated.
- [breaking fix]
new_*/1 and new_*/2 had conflicts, now there is only new_customer(record, attributes, changeset_function) and new_customer(attributes, changeset_function)
- [breaking fix]
stream_*_by/2 wasn't actually calling stream/0.
- [fix] Multiple specs are now correctly showing the options variant
2.0.0
- [feature] All functions that can now support the
options optional argument, which gets passed to Repo.all/*, Repo.one/*, Repo.get/*, Repo.stream/*, Repo.insert/*, Repo.update/*, and Repo.delete/*. This is useful for: Timeouts, prefixes, and more.
- [breaking] All
Read, Tagged and Slug functions that previously took subquery are now named _by/, for example Core.Users.list_accounts(&where(&1, name: "Kurtis Rainbolt-Greene")) now becomes Core.Users.list_accounts_by(&where(&1, name: "Kurtis Rainbolt-Greene")).
- [breaking] All
Write functions that previously took custom changeset functions are now named _by/, for example Core.Users.create_account(&Core.Users.Account.update_name_changeset/2, %{name: "Kurtis Rainbolt-Greene"}) now becomes Core.Users.create_account_by(%{name: "Kurtis Rainbolt-Greene"}, &Core.Users.Account.update_name_changeset/2).
- [breaking] I've removed the
get_*_by(Keyword.t()) function because it doesn't make sense given the subquery enabled read function.
- [breaking] I've moved
EctoInterface.Read.PubSub to EctoInterface.PubSub since it has both read/write functions.
1.3.0
- [feature] New
EctoInterface.Read.PubSub module for supercharging your contexts with pubsub capabilities. Requires default_pubsub as a configuration.
- [feature] New
stream_*/0 and stream_*/1 functions that return an Stream from Ecto. Must be executed inside a transaction like all ecto streaming.
- [feature] Added the ability to define which changeset is used in
new_*/*, change_*/*, update_*/*, and create_*/*.
- Increased test robustness.
1.2.0
- [feature]
get_*/1 take a id (a primary key) or a subquery, but that forces the query version to do the limit, where, and one, now we have two: get_*/1 that takes an id or a query and get_*/2 which takes an id and subquery where we do the expected work.
1.1.1
- [bugfix] Accidentally was passing the changeset to the preload function, added some tests as well
1.1.0
- [feature] Now when create/updating a resource you can pass in a
preload: [] keyword like for Repo.preload/1
1.0.0