Posts by José Valim

Replacing GenEvent by a Supervisor + GenServer

The downsides of GenEvent have been extensively documented. For those reasons, the Elixir team has a long term plan of deprecating GenEvent. Meanwhile, we are introducing tools, such as Registry (upcoming on Elixir v1.4) and GenStage, which better address domains developers would consider using GenEvent for. However, there is a very minimal replacement for GenEvent … »

Dynamic forms with Phoenix

Today we will learn how to build forms in Phoenix that use our schema information to dynamically show the proper input fields with validations, errors and so on. We aim to support the following API in our templates: <%= input f, :name %> <%= input f, :address %> <%= input f, :date_of_birth %> <%= input … »

Beyond Functional Programming with Elixir and Erlang

I would like to add a slightly different perspective to functional programming in the Erlang VM: functional programming is not a goal in the Erlang VM. It is a means to an end. When designing the Erlang language and the Erlang VM, Joe, Mike and Robert did not aim to implement a functional programming language, … »

Ecto’s insert_all and schemaless queries

One of the functions added to Ecto 2.0 is Ecto.Repo.insert_all/3. insert_all allows developers to insert multiple entries at once into a repository: MyApp.Repo.insert_all(Post, [[title: “hello”, body: “world”], [title: “another”, body: “post”]]) Although insert_all is just a regular Elixir function, it plays an important role in Ecto 2.0 goals. To understand more about these goals, let’s … »

Ecto 2.0.0-rc is out!

We are really glad to announce the release candidate for Ecto 2.0 has been released. The upcoming Ecto version packs many goodies: We have migrated to DBConnection, which considerably improves the performance of how Ecto manages connections to the database as a whole. Improved pool management, faster encoding/decoding, support for prepared queries and more; The … »

Ecto 2.0.0-beta.0 is out!

Hello everyone, We are really glad to announce that Ecto 2.0.0-beta.0 has been released. The upcoming Ecto version packs many goodies: We have migrated to DBConnection, which considerably improves the performance of how Ecto manages connections to the database as a whole. Improved pool management, faster encoding/decoding, support for prepared queries and more The effective … »