Writing a query - translation approach

I made a reply related to this topic here: How do i produce an elixir struct from erlang