MechanicalRabbit / FunSQL.jl

Julia library for compositional construction of SQL queries
https://mechanicalrabbit.github.io/FunSQL.jl
Other
146 stars 6 forks source link

`Agg` should always require a `Group` node. #9

Closed xitology closed 2 years ago

xitology commented 3 years ago
using FunSQL: SQLTable, From, Select, Get, Agg, render
person = SQLTable(:person, :person_id, :year_of_birth, :location_id)
q = From(person) |> Select(Get.person_id, Agg.count())
print(render(q))
#=>
SELECT "person_1"."person_id", COUNT(*) AS "count"
FROM "person" AS "person_1"
=#

This should instead raise an error.

xitology commented 2 years ago

Fixed in 5db345e.