diff --git a/src/Database/Esqueleto/Internal/Sql.hs b/src/Database/Esqueleto/Internal/Sql.hs index 82085f4..492a12d 100644 --- a/src/Database/Esqueleto/Internal/Sql.hs +++ b/src/Database/Esqueleto/Internal/Sql.hs @@ -720,6 +720,7 @@ makeWhere conn (Where (ERaw _ f)) = first ("\nWHERE " <>) (f conn) makeGroupBy :: Connection -> GroupByClause -> (TLB.Builder, [PersistValue]) +makeGroupBy _ (GroupBy []) = (mempty, []) makeGroupBy conn (GroupBy fields) = first ("\nGROUP BY " <>) build where build = uncommas' $ map (\(SomeValue (ERaw _ f)) -> f conn) fields