@@ -24,50 +24,50 @@ spec = do
2424 let
2525 statement :: Query '[] Tables Tables SumAndCol1
2626 statement = select $
27− project ((#col1 + #col2) `As` #sum :& #col1 :& RNil)
28− & from (#table1 & where_ true)
27+ ((#col1 + #col2) `As` #sum :& #col1 :& RNil)
28+ `from` (#table1 & where_ true)
2929 statement `shouldRenderAs`
3030 "SELECT (col1 + col2) AS sum, col1 AS col1 FROM table1 WHERE TRUE;"
3131 it "combines WHEREs using AND" $ do
3232 let
3333 statement :: Query '[] Tables Tables SumAndCol1
3434 statement = select $
35− project ((#col1 + #col2) `As` #sum :& #col1 :& RNil)
36− & from (#table1 & where_ true & where_ false)
35+ ((#col1 + #col2) `As` #sum :& #col1 :& RNil)
36+ `from` (#table1 & where_ true & where_ false)
3737 statement `shouldRenderAs`
3838 "SELECT (col1 + col2) AS sum, col1 AS col1 FROM table1 WHERE (TRUE AND FALSE);"
3939 it "performs sub SELECTs" $ do
4040 let
41− selection = project ((#col1 + #col2) `As` #sum :& #col1 :& RNil) & from #table1
41+ selection = ((#col1 + #col2) `As` #sum :& #col1 :& RNil) `from` #table1
4242 statement :: Query '[] Tables Tables SumAndCol1
43− statement = select $ star & from (subselect (selection `As` #sub))
43+ statement = select $ starFrom (subselect (selection `As` #sub))
4444 statement `shouldRenderAs`
4545 "SELECT * FROM SELECT (col1 + col2) AS sum, col1 AS col1 FROM table1 AS sub;"
4646 it "does LIMIT clauses" $ do
4747 let
4848 statement :: Query '[] Tables Tables Columns
49− statement = select $ star & from (#table1 & limit 1)
49+ statement = select $ starFrom (#table1 & limit 1)
5050 statement `shouldRenderAs` "SELECT * FROM table1 LIMIT 1;"
5151 it "should use the minimum of given LIMITs" $ do
5252 let
5353 statement :: Query '[] Tables Tables Columns
54− statement = select $ star & from (#table1 & limit 1 & limit 2)
54+ statement = select $ starFrom (#table1 & limit 1 & limit 2)
5555 statement `shouldRenderAs`
5656 "SELECT * FROM table1 LIMIT CASE WHEN (1 <= 2) THEN 1 ELSE 2 END;"
5757 it "should render parameters using $ signs" $ do
5858 let
5959 statement :: Query '[ 'PGInt8] Tables Tables Columns
60− statement = select $ star & from (#table1 & limit param1)
60+ statement = select $ starFrom (#table1 & limit param1)
6161 statement `shouldRenderAs` "SELECT * FROM table1 LIMIT $1;"
6262 it "does OFFSET clauses" $ do
6363 let
6464 statement :: Query '[] Tables Tables Columns
65− statement = select $ star & from (#table1 & offset 1)
65+ statement = select $ starFrom (#table1 & offset 1)
6666 statement `shouldRenderAs` "SELECT * FROM table1 OFFSET 1;"
6767 it "should use the sum of given OFFSETs" $ do
6868 let
6969 statement :: Query '[] Tables Tables Columns
70− statement = select $ star & from (#table1 & offset 1 & offset 2)
70+ statement = select $ starFrom (#table1 & offset 1 & offset 2)
7171 statement `shouldRenderAs` "SELECT * FROM table1 OFFSET (1 + 2);"
7272 it "correctly render simple INSERTs" $ do
7373 let
@@ -84,14 +84,14 @@ spec = do
8484 "INSERT INTO students (name) VALUES (E'Robert''); DROP TABLE students;');"
8585 describe "JOINs" $ do
8686 let
87− vals = project $
87+ vals =
8888 #orders .&. #orderVal `As` #orderVal
8989 :& #customers .&. #customerVal `As` #customerVal
9090 :& #shippers .&. #shipperVal `As` #shipperVal :& RNil
9191 it "should render CROSS JOINs" $ do
9292 let
9393 statement :: Query '[] JoinTables JoinTables ValueColumns
94− statement = select $ vals & from
94+ statement = select $ vals `from`
9595 (tables (#orders & crossJoin #customers & crossJoin #shippers))
9696 statement `shouldRenderAs`
9797 "SELECT\
@@ -111,7 +111,7 @@ spec = do
111111 & innerJoin #shippers
112112 (#orders .&. #shipperID ==* #shippers .&. #shipperID)
113113 selection :: Query '[] JoinTables JoinTables ValueColumns
114− selection = select $ vals & from innerJoins
114+ selection = select $ vals `from` innerJoins
115115 selection `shouldRenderAs`
116116 "SELECT\
117117 \ orders.orderVal AS orderVal,\