Talked about what's new in Ecto 3, with the perspective of how to upgrade from Ecto 2 to Ecto 3 for an existing app
Presented at March 2019 meetup of Elixir Sydney
https://www.meetup.com/sydney-ex/events/kznqrpyzfbjb/
changes » JSON handling changes » Added named bindings for better join composition » DateTime related changes » Instrumentation for Prometheus » Other changes ...
as: :posts, join: c in Comment, + as: :comments, on: p.id == c.post_id, select: c from [comments: c] in query, where: c.public from [posts: p] in query, where: p.published
Ecto will raise when inserting timestamp field with microseconds » truncate to remove microseconds part DateTime.truncate(dt, :second) NaiveDateTime.truncate(dt, :second)
do MyApp.Repo.Instrumenter.setup() :telemetry.attach( "prometheus-ecto-myapp", [:my_app, :repo, :query], &MyApp.Repo.Instrumenter.handle_event/4, %{} ) {:ok, opts} end end
2 » DBConnection 2 added ConnectionPool module to manage connection pool » Dropped support for external pools » The built-in connection pool does not offer API for getting connection info