Releases: elixir-ecto/ecto
Releases · elixir-ecto/ecto
v0.3.0
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 anEcto.CastError
preload
,lock
andorder_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 passvirtual: true
as field option- Adapter API for
insert
,update
anddelete
has been simplified
v0.2.8
v0.2.7
v0.2.6
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
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 insidearray/2
andbinary/1
Backwards incompatible changes
- Do not translate
foo == nil
to the SQLfoo IS NULL
, provideis_nil/1
instead
v0.2.4
Enhancements
- Better error message if repo is not started
- Do not require
^
on literals insidearray/2
orfield/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
v0.2.2
v0.2.1
Enhancements
- Add support for all query expressions in
order_by
,group_by
anddistinct
expressions, instead of only allowing lists of fields - Add
Ecto.Model.scoped/2
as a shorthand forfrom(x in __MODULE__, ...)
Bug fixes
- Aggregate functions in
order_by
,distinct
andselect
will make the query grouped
Backwards incompatible changes
- Single variables in
group_by
anddistinct
no longer expands to a list of fields
v0.2.0
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