Skip to content

Releases: elixir-ecto/ecto

v0.3.0

13 Jan 19:38
Compare
Choose a tag to compare

Enhancements

  • Support fragments in queries with the fragment(...) function
  • Interpolated values in queries are now automatically cast. For example, from u in User, where: u.age > ^"10" will automatically cast "10" to an integer. Failing to cast will trigger an Ecto.CastError
  • preload, lock and order_by now allow dynamic values
  • Improve and relax type inference. Ecto no longer requires array(array, type), binary(...) and so on for interpolated values. In fact, the functions above have been removed

Backwards incompatible changes

  • :virtual type no longer exists, instead pass virtual: true as field option
  • Adapter API for insert, update and delete has been simplified

v0.2.8

13 Jan 19:37
Compare
Choose a tag to compare

Bug fixes

  • Validation predicates now receive the attribute as first argument

v0.2.7

13 Jan 19:36
Compare
Choose a tag to compare

Enhancements

  • Add support for Ecto.Model.Callbacks

Bug fixes

  • Fix merging of validation errors when using validation_also

v0.2.6

13 Dec 22:26
Compare
Choose a tag to compare

Enhancements

  • Log queries by default
  • Pretty print queries (Inspect protocol implemented)

Bug fixes

  • Cast primary key in Repo.get/2
  • Use repository port in Mix tasks
  • Fix type checking in Repo.update_all/2

Backwards incompatible changes

  • Return validation errors as maps
  • Fix belongs_to preload if no associated record exists

v0.2.5

17 Sep 18:47
Compare
Choose a tag to compare

Enhancements

  • Change timeout of migration queries to infinity
  • Add uuid type

Bug fixes

  • Fix encoding of interpolated nil values
  • Support interpolated large integers
  • Support interpolating values on Repo.update_all
  • Correctly handle nil values inside array/2 and binary/1

Backwards incompatible changes

  • Do not translate foo == nil to the SQL foo IS NULL, provide is_nil/1 instead

v0.2.4

08 Sep 10:32
Compare
Choose a tag to compare

Enhancements

  • Better error message if repo is not started
  • Do not require ^ on literals inside array/2 or field/2
  • Parametrize queries, interpolated values are no longer encoded as literals in the generated SQL query, instead they are sent as query parameters
  • Allow starting the assoc selection from a joined association or building it from right outer joins

Bug fixes

  • Remove possible deadlock for models using each other in queries

v0.2.3

08 Sep 10:32
Compare
Choose a tag to compare

Enhancements

  • Add local and utc to Ecto.DateTime and Ecto.Date

Bug fixes

  • Treat nil as an any data type
  • Support array of binaries
  • Avoid race conditions when optimizing query compilation

v0.2.2

30 Jun 10:45
Compare
Choose a tag to compare

Enhancements

  • Do not require username and password to be present in parse_url/1

v0.2.1

18 Jun 21:29
Compare
Choose a tag to compare

Enhancements

  • Add support for all query expressions in order_by, group_by and distinct expressions, instead of only allowing lists of fields
  • Add Ecto.Model.scoped/2 as a shorthand for from(x in __MODULE__, ...)

Bug fixes

  • Aggregate functions in order_by, distinct and select will make the query grouped

Backwards incompatible changes

  • Single variables in group_by and distinct no longer expands to a list of fields

v0.2.0

24 May 12:40
Compare
Choose a tag to compare

Enhancements

  • Add Ecto.Assocations.load/3 for loading associations
  • Add Ecto.Model.primary_key/1 and Ecto.Model.put_primary_key/3 for accessing a model's primary key
  • Add Ecto.Repo.one and Ecto.Repo.one! for running query expecting one result
  • Add Ecto.Repo.get! that raises when receiving no result
  • Set foreign key when loading belongs_to association to model

Bug fixes

  • Ensure that existing primary key is not overwritten when inserting model
  • Ecto.Repo.get no longer adds limit: 1 to query, it will now raise when receiving more than one result
  • Properly underscore camelized names in associated models

Backwards incompatible changes

  • Removed entities in favor of schema + structs. In particular, Ecto.Entity is gone as well as the queryable/2 macro. Instead developers should invoke schema/2 in their models, which will automatically define a struct in the current module. Now to create or update, developers should use struct(Post, []) or %Post{} instead of the previous Post.new([]) or Post[]
  • Renamed has_many association function to_list to all
  • Ecto.Repo.storage_down and Ecto.Repo.storage_up moved to Ecto.Storage