Releases: elixir-ecto/ecto
Releases · elixir-ecto/ecto
v1.1.2
v1.1.1
Bug fixes
- Remove documentation for unfinished
on_replace
option incast_assoc
,cast_embed
,put_assoc
andput_embed
. The option could be given and applied to the changeset but it would never reach the repository, giving the impression it works as expected but ultimately failing in the repository operation
Deprecations
- Add missing deprecation on
Ecto.Changeset.cast/3
v1.1.0
Ecto v1.1.0 brings many improvements and bug fixes.
In particular v1.1.0 deprecates functionality that has been shown by developers to be confusing, unclear or error prone. They include:
Ecto.Model
's callbacks have been deprecated in favor of composing with changesets and of schema serializersEcto.Model
'soptimistic_lock/1
has been deprecated in favor ofEcto.Changeset.optimistic_lock/3
, which gives more fine grained control over the lock by relying on changesets- Giving a model to
Ecto.Repo.update/2
has been deprecated as it is ineffective and error prone since changes cannot be tracked Ecto.DateTime.local/0
has been deprecated- The association and embedded functionality from
Ecto.Changeset.cast/4
has been moved toEcto.Changeset.cast_assoc/3
andEcto.Changeset.cast_embed/3
- The association and embedded functionality from
Ecto.Changeset.put_change/3
has been moved toEcto.Changeset.put_assoc/3
andEcto.Changeset.put_embed/3
Furthermore, the following functionality has been soft-deprecated (they won't emit warnings for now, only on Ecto v2.0):
Ecto.Model
has been soft deprecated.use Ecto.Schema
instead ofuse Ecto.Model
and invoke the functions inEcto
instead of the ones inEcto.Model
Keep on reading for more general information about this release.
Enhancements
- Optimize Ecto.UUID encoding/decoding
- Introduce pool timeout and set default value to 15000ms
- Support lists in
Ecto.Changeset.validate_length/3
- Add
Ecto.DataType
protocol that allows an Elixir data type to be cast to any Ecto type - Add
Ecto.Changeset.prepare_changes/2
allowing the changeset to be prepared before sent to the storage - Add
Ecto.Changeset.traverse_errors/2
for traversing all errors in a changeset, including the ones from embeds and associations - Add
Ecto.Repo.insert_or_update/2
- Add support for exclusion constraints
- Add support for precision on
Ecto.Time.utc/1
andEcto.DateTime.utc/1
- Support
count(expr, :distinct)
in query expressions - Support prefixes in
table
andindex
in migrations - Allow multiple repos to be given to Mix tasks
- Allow optional binding on
Ecto.Query
operations - Allow keyword lists on
where
, for example:from Post, where: [published: true]
Bug fixes
- Ensure we update embedded models state after insert/update/delete
- Ensure psql does not hang if not password is given
- Allow fragment joins with custom
on
statement
v1.0.7
v1.0.6
v1.0.5
Bug fixes
- Ensure
__meta__
is not overridable inEcto.Model.build/3
- Ensure adapters are shut down after running migrations so caches are reloaded
- Do not trigger
:on_replace
behaviour ifhas_one
model is being updated - Raise helpful error when using wrong Ecto native types
- Make
Ecto.DateTime.cast/1
support over 6 decimal places
v1.0.4
v1.0.3
Enhancements
- Allow escaping of
?
in fragment string
Bug fixes
- Ensure ids are unique in preloader queries
- Ensure relations cannot be replaced by default via changesets
- Ensure query cache changes when the schema fields change
- Ensure the model is always used on changes, even with multiple cast calls
- Ensure relations are properly marked as required in changeset cast
- Build models using the relation information on changeset cast for associations
v1.0.2
Enhancements
- Add
Ecto.Model.put_meta/2
- Document supported formats in datetime
- Prepend model key ordering on preload
Bug fixes
- Ensure we can cast a changeset with
:empty
- Ensure we prepend repo configuration instead of appending in
mix ecto.gen.repo
- Allow non-matching ids to given on assocs or embeds as long as the underlying changeset has action
:insert
- Make sure relations can be appended on
Ecto.Changeset.put_change/3
- Ensure we return the original changeset when child constraint fails
- Always force timestamp update for models (without changesets)
- Warn on bad default for
belongs_to
associations
v1.0.1
Bug fixes
- Raise a proper error message if trying to change a belongs_to association
- Raise a proper error message if Ecto.Model/Ecto.Schema are used but no schema is defined
- Ensure dump after cast is still handled as
Ecto.CastError
as it assumes poor casting - Support constraints on Postgres versions earlier than 9.4