Enhancements
- Add
Ecto.Assocations.load/3
for loading associations - Add
Ecto.Model.primary_key/1
andEcto.Model.put_primary_key/3
for accessing a model's primary key - Add
Ecto.Repo.one
andEcto.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 addslimit: 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 thequeryable/2
macro. Instead developers should invokeschema/2
in their models, which will automatically define a struct in the current module. Now to create or update, developers should usestruct(Post, [])
or%Post{}
instead of the previousPost.new([])
orPost[]
- Renamed has_many association function
to_list
toall
Ecto.Repo.storage_down
andEcto.Repo.storage_up
moved toEcto.Storage