Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opaleye suffers from the HaskellDB union/aggregation bug #74

Open
tomjaguarpaw opened this issue Aug 28, 2014 · 1 comment
Open

Opaleye suffers from the HaskellDB union/aggregation bug #74

tomjaguarpaw opened this issue Aug 28, 2014 · 1 comment

Comments

@tomjaguarpaw
Copy link
Collaborator

m4dc4p/haskelldb#17

import qualified Karamaan.Opaleye.Reexports as R
import qualified Karamaan.Opaleye.Table as T
import qualified Karamaan.Opaleye.Operators2 as O
import qualified Karamaan.Opaleye.Aggregate as A
import qualified Karamaan.Opaleye.SQL as S

t :: R.Query (R.Wire Double)
t = T.makeTableDef "column" "table"

example :: R.Query (R.Wire Double)
example = A.aggregate A.sum (t `O.union` t)

run :: IO ()
run = fmap putStrLn S.showSqlForPostgresDefault example

*Main> run
(SELECT SUM(column) as column_1_3_4
 FROM table as T1)
UNION
(SELECT SUM(column) as column_1_3_4
 FROM table as T1)
@tomjaguarpaw
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant