Elixir Ecto 2.2.0-rc.0 released

New update of Elixir database tool is available now 
09 August 2017   554

What is Ecto?

Ecto is a domain specific language for writing queries and interacting with databases in Elixir. Ecto provides a standardised API and a set of abstractions for talking to all the different kinds of databases, so that Elixir developers can query whatever database they’re using by employing similar contructs. 

Ecto is compatible with:

  • PostgreSQL
  • MySQL
  • c    

What's new in 2.2.0-rc.0?

This release adds many improvements to Ecto with a handful of bug fixes.


  • Ecto now supports specifying fields sources. 
  • [Ecto.Adapters] Accept IO data from adapters to reduce memory usage when performing large queries
  • [Ecto.Adapters.SQL] Also add Ecto.Repo.to_sql/2 to Ecto.Repo based on SQL adapters
  • [Ecto.Adapters.Postgres] Use the "postgres" database for create/drop database commands
  • [Ecto.Adapters.MySQL] Use TCP connections instead of MySQL command client to create & drop database
  • [Ecto.Changeset] Support action: :ignore in changeset which is useful when casting associations and embeds and one or more children need to be rejected/ignored under certain circumstances
  • [Ecto.Changeset] Add :repo_opts field to Ecto.Changeset which are given as options to to the repository whenever an operation is performed
  • [Ecto.Changeset] Add apply_action/2
  • [Ecto.Changeset] Add prefix constraint name checking to constraint validations
  • [Ecto.Changeset] Allow assocs and embeds in change/2 and put_change/3 - this gives a more generic API for developers to work that does not require explicit knowledge of the field type
  • [Ecto.Migration] Add reversible execute/2 to migrations
  • [Ecto.Migration] Add :migration_timestamps and :migration_primary_key to control the migration defaults from the repository
  • [Ecto.Migrator] Allow migration/rollback to log SQL commands via the --log-sql flag
  • [Ecto.LogEntry] Add :caller_pid to the Ecto.LogEntry struct
  • [Ecto.Query] Allow map updates in subqueries
  • [Ecto.Query] Support fragment and field access in type/2 in select
  • [Ecto.Query] Add select_merge/3 as a composable API for selects
  • [Ecto.Repo] Implement :returning option on insert
  • [Ecto.Repo] Add ON CONSTRAINT support to :conflict_target on insert and insert_all
  • [Ecto.Repo] Raise MultiplePrimaryKeyError when primary key is not unique on DB side
  • [Ecto.Schema] Validate schemas after compilation - this helps developers catch early mistakes such as foreign key mismatches early on
  • [Ecto.Type] Allow adapters to pass Date, Time, NaiveDateTime and DateTime on load if desired
  • [Ecto.UUID] Allow casting binary UUIDs
  • [mix ecto.drop] Add --force
  • [mix ecto.load] Add --force and prompt user to confirm before continuing in production

Bug fixes

  • [Ecto.Changeset] Remove the field from changes if it does not pass validate_required
  • [Ecto.Changeset] Raise if changeset struct does not match relation
  • [Ecto.Query] Consistently raise if nil is interpolated on the right side of in
  • [Ecto.Query] Properly expand macros in select
  • [Ecto.Query] Support or_having in keyword query
  • [Ecto.Query] Properly count the parameters when using interpolation inside a select inside a subquery
  • [Ecto.Repo] Set struct prefix on insertdelete, and update when the prefix is given as an option
  • [Ecto.UUID] Validate UUID version on casting
  • [mix ecto.*] Make sure Logger is rebootted when running ecto tasks
  • [mix ecto.*] No longer mark tasks as recursive and instead collect all repositories upfront. This fixes a bug where migration and rollback commands for a given repository could be executed multiple times from an umbrella project


  • [Ecto.DateTime] Ecto.DateTime as well as Ecto.Date and Ecto.Time are deprecated in favor of :naive_datetime:date and :time respectively
  • [Ecto.Repo] Using {:system, env} to configure the repository URL is deprecated in favor of a custom init/2 callback

You can learn more at GitHub

ElixirLangMoscow Meetup #7

Meetup will be held on February 15th, Thursday, in Moscow, Pyatnitsky Lane 2
22 January 2018   250

Club ElixirLangMoscow invites all lovers of Elixir, Erlang and functional programming languages to the next meeting of our club. This time the event was decided to be held in the "Dear, I will call back" bar. Because, what could be better than listening to interesting reports for a glass of beer. And even in the company of friends!


We are waiting for two cool reports and a free microphone for those who have something to say.

Dmitry Rubinstein

Topic: “Introduction to Agala

Dmitry Rubinstein
Dmitry Rubinstein

The report will highlight the Agala framework - a platform for real-time interaction with third-party services. Currently, this platform has implemented bots for Telegram and Vk, which are used in the combat environment in our company. Let's analyze the main differences from the known solutions for creating bots on Elixir, consider the internal structure of the platform and learn how to support any necessary third-party service.

Dmitry Rubinstein

Alexandr Shorin 

Topic: “Apache CouchDB: more than a database with HTTP API

Alexandr Shorin
Alexandr Shorin

This will be an introductory report with Apache CouchDB and its ecosystem. Main features and capabilities. Details of the implementation of the replication protocol and why this is important. Forks: Couchbase, Cloudant - what are the differences and why should not they be confused with the original project. The history of clustering, what happened in the end in 2.0 and how it works. What is interesting about the new release and where the project is heading.

Alexandr Shorin 

As a pleasant chip, the bar will prepare an "Elixir" cocktail especially for us. Admission is free, everyone pays their bill.

The event has an age limit of 18+. Register for free.