generated from tpl/purs
Add test for DELETE query which returns removed rows.
This commit is contained in:
parent
624cf730e6
commit
9ae93cede4
@ -5,6 +5,7 @@
|
||||
"decimal.js": "^10.0.0",
|
||||
"g": "^2.0.1",
|
||||
"global": "^4.3.2",
|
||||
"pg": "^6.1.2"
|
||||
"pg": "^6.1.2",
|
||||
"pulp": "^12.3.0"
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ import Test.Unit.Main (runTest)
|
||||
|
||||
withRollback
|
||||
∷ ∀ a
|
||||
. Connection
|
||||
. Connection
|
||||
→ Aff a
|
||||
→ Aff Unit
|
||||
withRollback conn action = do
|
||||
@ -135,6 +135,15 @@ main = void $ launchAff do
|
||||
""") Row0
|
||||
liftEffect <<< assert $ names == [Row2 "pork" true, Row2 "rookworst" true]
|
||||
|
||||
test conn "delete column subset" $ do
|
||||
insertFood
|
||||
deleted <- query conn (Query """
|
||||
DELETE FROM foods
|
||||
WHERE delicious
|
||||
RETURNING name, delicious
|
||||
""") Row0
|
||||
liftEffect <<< assert $ deleted == [Row2 "pork" true, Row2 "rookworst" true]
|
||||
|
||||
test conn "handling instant value" $ do
|
||||
before <- liftEffect $ (unwrap <<< unInstant) <$> now
|
||||
insertFood
|
||||
|
Loading…
Reference in New Issue
Block a user