Skip to content

how to use groupBy #185

Answered by shane-circuithub
marcosh asked this question in Q&A
Discussion options

You must be logged in to vote
{-# language DeriveAnyClass #-}
{-# language DeriveGeneric #-}
{-# language NamedFieldPuns #-}
{-# language OverloadedStrings #-}

module Foo
  ( query
  , test
  ) where

-- base
import GHC.Generics (Generic)

-- rel8
import Rel8
  ( Expr
  , Column
  , Name
  , Query
  , Rel8able
  , TableSchema(..)
  , aggregate
  , each
  , groupBy
  , listAggExpr
  , showQuery
  )

-- text
import Data.Text (Text)


data Bar f = Bar
  { foo :: Column f Text
  , baz :: Column f Text
  } deriving (Generic, Rel8able)


barSchema :: TableSchema (Bar Name)
barSchema = TableSchema
  { name = "bar"
  , schema = Nothing
  , columns = Bar
      { foo = "foo"
      , baz = "baz"
      }
  }


query :: Query (Expr 

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by ocharles
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@marcosh
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #181 on June 21, 2022 12:24.