MechanicalRabbit / FunSQL.jl

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

ORDER BY clause for aggregate functions #29

Closed xitology closed 9 months ago

xitology commented 9 months ago

This can now be done with templates:

using FunSQL

c = FunSQL.AGG("string_agg(?, ? ORDER BY ?)", :zip, ",", :zip)
#-> AGG("string_agg(?, ? ORDER BY ?)", ID(:zip), LIT(","), ID(:zip))

print(FunSQL.render(c))
#-> string_agg("zip", ',' ORDER BY "zip")