github elixir-ecto/ecto v0.2.0

latest releases: v3.11.2, v3.11.1, v3.11.0...
9 years ago

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

Don't miss a new ecto release

NewReleases is sending notifications on new releases.