FunSQL.jl icon indicating copy to clipboard operation
FunSQL.jl copied to clipboard

do not collapse Define nodes

Open xitology opened this issue 4 years ago • 0 comments
trafficstars

using FunSQL: SQLTable, From, Select, Join, Where, Group, Define, Fun, Get, Agg, render
person = SQLTable(:person, :person_id, :year_of_birth, :location_id)
q = Define(:complex_expression => From(person) |> Group() |> Select(Agg.count())) |>
    Select(Get.complex_expression .+ Get.complex_expression)
print(render(q))
#=>
SELECT ((
  SELECT COUNT(*) AS "count"
  FROM "person" AS "person_1"
) + (
  SELECT COUNT(*) AS "count"
  FROM "person" AS "person_1"
)) AS "+"
=#

xitology avatar Sep 09 '21 13:09 xitology