Ecto.Query.API.coalesce

You're seeing just the function coalesce, go back to Ecto.Query.API module for more information.

Takes whichever value is not null, or null if they both are.

In SQL, COALESCE takes any number of arguments, but in ecto it only takes two, so it must be chained to achieve the same effect.

from p in Payment, select: p.value |> coalesce(p.backup_value) |> coalesce(0)