Named binding for initial queryable

If I have:

|> join(:inner, [t], x in X, as: :x, on: t.x_id =
|> join(:inner, [_, x], y in Y, as: :y, on: x.y_id =

I have named bindings for x and y, which is great so i don’t have to remember their position. Is there a way to name the binding used to represent Thing?

isn’t t the binding that represents Thing (the first one in the list, that’s ignored in the second join)?

Yeah but I want to be able to name that binding so the order doesn’t matter.

UPD, ignore this :slightly_smiling_face: Benjamin has the answer =)

I see.
as far as I remember the main relation (Thing) will always be the first in the list and the rest could be a keyword list like

|> join(:inner, [a], u in User, as: :user, on: u.account_id =
|> join(:inner, [_, user: u], l in Like, as: :like, on: l.user_id =
|> join(:inner, [thing, user: u, like: l], ...)

from/2 allows you to set the name for the first binding.

|> from(as: :thing)
|> …