@@ -388,15 +388,6 @@ data By
388 => (Alias table, Alias column)
388 => (Alias table, Alias column)
389 -> By tables '(table, column)
389 -> By tables '(table, column)
392− :: ( KnownSymbol table
393− , tables ~ '[table ::: columns]
394− , HasColumn column columns ty
397− -> By tables '(table, column)
398−by column = By (Alias (proxy# :: Proxy# (table :: Symbol)), column)
400renderBy :: By tables tabcolty -> ByteString
391renderBy :: By tables tabcolty -> ByteString
401renderBy (By (table, column)) = renderAlias table <> "." <> renderAlias column
392renderBy (By (table, column)) = renderAlias table <> "." <> renderAlias column
@@ -429,12 +420,17 @@ renderHavingClause = \case
430class (KnownSymbol table, KnownSymbol column)
421class (KnownSymbol table, KnownSymbol column)
431 => GroupedBy table column bys where
422 => GroupedBy table column bys where
432− getGroup
423+ getGroup1
424+ :: (tables ~ '[table ::: columns], HasColumn column columns ty)
426+ -> Expression params tables ('Grouped bys) ty
427+ getGroup1 column = UnsafeExpression $ fromString (symbolVal' column)
433 :: (HasTable table tables columns, HasColumn column columns ty)
429 :: (HasTable table tables columns, HasColumn column columns ty)
434 => Alias table
430 => Alias table
435 -> Alias column
431 -> Alias column
436 -> Expression params tables ('Grouped bys) ty
432 -> Expression params tables ('Grouped bys) ty
437− getGroup table column = UnsafeExpression $
433+ getGroup2 table column = UnsafeExpression $
438 renderAlias table <> "." <> renderAlias column
434 renderAlias table <> "." <> renderAlias column
439instance {-# OVERLAPPING #-} (KnownSymbol table, KnownSymbol column)
435instance {-# OVERLAPPING #-} (KnownSymbol table, KnownSymbol column)
440 => GroupedBy table column '[ '(table,column)]
436 => GroupedBy table column '[ '(table,column)]
@@ -449,16 +445,14 @@ instance
449 , HasColumn column columns ty
445 , HasColumn column columns ty
450 , GroupedBy table column bys
446 , GroupedBy table column bys
451 ) => IsLabel column
447 ) => IsLabel column
452− (Expression params tables ('Grouped bys) ty) where
448+ (Expression params tables ('Grouped bys) ty) where fromLabel = getGroup1
453− fromLabel p = getGroup (Alias (proxy# :: Proxy# table)) (Alias p)
456 ( HasTable table tables columns
451 ( HasTable table tables columns
457 , HasColumn column columns ty
452 , HasColumn column columns ty
458 , GroupedBy table column bys
453 , GroupedBy table column bys
459 ) => TableColumn table column
454 ) => TableColumn table column
460− (Expression params tables ('Grouped bys) ty) where
455+ (Expression params tables ('Grouped bys) ty) where (&.) = getGroup2
463unsafeAggregate
457unsafeAggregate
464 :: ByteString
458 :: ByteString