I was trying to use ecto's :inner_lateral And I wrote this query
SnapshotExtractor
|> order_by(desc: :created_at)
|> limit(1)
|> join(:inner_lateral, [se], cam in fragment("SELECT * FROM cameras as cam WHERE cam.id = ?", se.camera_id))
|> select([se, cam], { se.from_date, se.to_date, se.interval, se.schedule, cam.exid, cam.timezone})
|> Repo.one
Its working fine and giving me good resuls but its giving me an un-named object, no name with the resulting values.. Question is can we add names to the values as well? my resulting values are
{#Ecto.DateTime<2016-02-25 00:00:00>, #Ecto.DateTime<2016-02-25 00:00:00>, 0,
%{"Friday" => [], "Monday" => ["0:0-0:0"], "Saturday" => [], "Sunday" => [],
"Thursday" => [], "Tuesday" => [], "Wednesday" => []}, "oscar2", nil}