@@ -81,15 +81,21 @@ spec = do
8181 statement = update #table1 (set 2 `As` #col1 :* same `As` #col2 :* Nil) ((#col1 :: Expression '[] Tables ('Required ('NotNull 'PGInt4))) /=* #col2)
8282 statement `shouldRenderAs`
8383 "UPDATE table1 SET col1 = 2 WHERE (col1 <> col2);"
84− -- it "correctly render upsert INSERTs" $ do
85− -- let
86− -- statement :: Statement '[] '[] Tables Tables
87− -- statement = upsertInto #table1
88− -- (2 `As` #col1 :* 4 `As` #col2 :* Nil)
89− -- (set 2 `As` #col1 :* same `As` #col2 :* Nil)
90− -- (#col1 /=* #col2)
91− -- statement `shouldRenderAs`
92− -- "UPDATE table1 SET col1 = 2 WHERE TRUE;"
84+ it "correctly render upsert INSERTs" $ do
85+ let
86+ statement :: Statement '[] '[] Tables Tables
87+ statement = upsertInto #table1
88+ (2 `As` #col1 :* 4 `As` #col2 :* Nil)
89+ (set 2 `As` #col1 :* same `As` #col2 :* Nil)
90+ ((#col1 :: Expression '[] Tables ('Required ('NotNull 'PGInt4))) /=* #col2)
91+ statement `shouldRenderAs`
92+ "INSERT INTO table1 (col1, col2) VALUES (2, 4) ON CONFLICT UPDATE table1 SET col1 = 2 WHERE (col1 <> col2);"
93+ it "correctly renders DELETEs" $ do
94+ let
95+ statement :: Statement '[] '[] Tables Tables
96+ statement = delete #table1 ((#col1 :: Expression '[] Tables ('Required ('NotNull 'PGInt4))) ==* #col2)
97+ statement `shouldRenderAs`
98+ "DELETE FROM table1 WHERE (col1 = col2);"
9399 it "should be safe against SQL injection in literal text" $ do
94100 let
95101 statement :: Statement '[] '[] StudentsTable StudentsTable