@@ -388,15 +388,6 @@ data By
388388 => (Alias table, Alias column)
389389 -> By tables '(table, column)
390390
391−by
392− :: ( KnownSymbol table
393− , tables ~ '[table ::: columns]
394− , HasColumn column columns ty
395− )
396− => Alias column
397− -> By tables '(table, column)
398−by column = By (Alias (proxy# :: Proxy# (table :: Symbol)), column)
399−
400391renderBy :: By tables tabcolty -> ByteString
401392renderBy (By (table, column)) = renderAlias table <> "." <> renderAlias column
402393
@@ -429,12 +420,17 @@ renderHavingClause = \case
429420
430421class (KnownSymbol table, KnownSymbol column)
431422 => GroupedBy table column bys where
432− getGroup
423+ getGroup1
424+ :: (tables ~ '[table ::: columns], HasColumn column columns ty)
425+ => Proxy# column
426+ -> Expression params tables ('Grouped bys) ty
427+ getGroup1 column = UnsafeExpression $ fromString (symbolVal' column)
428+ getGroup2
433429 :: (HasTable table tables columns, HasColumn column columns ty)
434430 => Alias table
435431 -> Alias column
436432 -> Expression params tables ('Grouped bys) ty
437− getGroup table column = UnsafeExpression $
433+ getGroup2 table column = UnsafeExpression $
438434 renderAlias table <> "." <> renderAlias column
439435instance {-# OVERLAPPING #-} (KnownSymbol table, KnownSymbol column)
440436 => GroupedBy table column '[ '(table,column)]
@@ -449,16 +445,14 @@ instance
449445 , HasColumn column columns ty
450446 , GroupedBy table column bys
451447 ) => IsLabel column
452− (Expression params tables ('Grouped bys) ty) where
453− fromLabel p = getGroup (Alias (proxy# :: Proxy# table)) (Alias p)
448+ (Expression params tables ('Grouped bys) ty) where fromLabel = getGroup1
454449
455450instance
456451 ( HasTable table tables columns
457452 , HasColumn column columns ty
458453 , GroupedBy table column bys
459454 ) => TableColumn table column
460− (Expression params tables ('Grouped bys) ty) where
461− (&.) = getGroup
455+ (Expression params tables ('Grouped bys) ty) where (&.) = getGroup2
462456
463457unsafeAggregate
464458 :: ByteString