Skip to content

Releases: elixir-ecto/ecto

v1.1.2

22 Feb 10:46
Compare
Choose a tag to compare

Bug fixes

  • Be restrict on mariaex and postgrex dependencies

v1.1.1

23 Dec 15:32
Compare
Choose a tag to compare

Bug fixes

  • Remove documentation for unfinished on_replace option in cast_assoc, cast_embed, put_assoc and put_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

23 Dec 15:31
Compare
Choose a tag to compare

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 serializers
  • Ecto.Model's optimistic_lock/1 has been deprecated in favor of Ecto.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 to Ecto.Changeset.cast_assoc/3 and Ecto.Changeset.cast_embed/3
  • The association and embedded functionality from Ecto.Changeset.put_change/3 has been moved to Ecto.Changeset.put_assoc/3 and Ecto.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 of use Ecto.Model and invoke the functions in Ecto instead of the ones in Ecto.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 and Ecto.DateTime.utc/1
  • Support count(expr, :distinct) in query expressions
  • Support prefixes in table and index 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

23 Dec 15:34
Compare
Choose a tag to compare

Enhancements

  • Improve performance of Ecto.UUID encoding/decoding
  • No longer block poolboy when starting a non-lazy connection

Bug fixes

  • Do not allow interpolated strings in queries
  • Emit proper SQL for update all with postgres

v1.0.6

23 Dec 15:33
Compare
Choose a tag to compare

Bug fixes

  • Only shut down repo in "ecto.migrate" and "ecto.rollback" if it was created by the task

v1.0.5

23 Dec 15:33
Compare
Choose a tag to compare

Bug fixes

  • Ensure __meta__ is not overridable in Ecto.Model.build/3
  • Ensure adapters are shut down after running migrations so caches are reloaded
  • Do not trigger :on_replace behaviour if has_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

23 Dec 15:33
Compare
Choose a tag to compare

Enhancements

  • Support --quiet in ecto.rollback
  • Add support for ISO datetime strings in Ecto.Date.cast/1

Bug fixes

  • Ensure changeset constraints are merged on cast/merge
  • Underscore the migration file name given to mix ecto.gen.migration

v1.0.3

23 Dec 15:32
Compare
Choose a tag to compare

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

07 Sep 13:16
Compare
Choose a tag to compare

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

30 Aug 09:10
Compare
Choose a tag to compare

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