Why does a missing :on option in Ecto.Query.join/5 trigger this warning?

Why does removing on: true from a keyword query result in a warning?

missing :on in join, defaulting to on: true.

The :on option is documented as “defaults to true.


  • ecto_sql 3.10.2
  • elixir 1.15.4-otp-26
  • erlang 26.0.2

Well, you got me curious so I did some digging and found the PR that introduced the warning as well as the mailing list discussion discussing why. I agree that the docs could be improved to explain this a little better as it is a bit confusing.


Thanks for unearthing this! Glancing at Ecto source, this is probably the on: clause that allows Ecto.assoc/3 to not need it explicitly.

1 Like