7module Squeel.PostgreSQL.QuerySpec where
13import Squeel.PostgreSQL.Query
14import Squeel.PostgreSQL.Type
18 it "correctly renders a simple SELECT query" $ do
19 renderQuery (select (sumAndCol1 `from` (table1 `where_` true)))
21 "SELECT col1+col2 AS sum, col1 AS col1 FROM table1 WHERE TRUE"
22 it "combines WHEREs using AND" $ do
23 renderQuery (select (sumAndCol1 `from` (table1 `where_` true `where_` false)))
25 "SELECT col1+col2 AS sum, col1 AS col1 FROM table1 WHERE TRUE AND FALSE"
32sumAndCol1 :: Projection '[] Columns
36sumAndCol1 = project ((#col1 + #col2) `As` #sum :& #col1 :& RNil)
38table1 :: Relation '[] '[ '("table1", Columns)] Columns
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list