@@ -45,12 +45,11 @@ testDriver = testGroup "Driver"
4545 ]
4646
4747makeQuery1 :: B. ByteString -> Query
48- makeQuery1 n = Query " SELECT $1" (V. fromList [(Oid 23 , Just n)])
49- Text Text AlwaysCache
48+ makeQuery1 n = Query " SELECT $1" [(Oid 23 , Just n)] Text Text AlwaysCache
5049
5150makeQuery2 :: B. ByteString -> B. ByteString -> Query
5251makeQuery2 n1 n2 = Query " SELECT $1 + $2"
53- ( V. fromList [(Oid 23 , Just n1), (Oid 23 , Just n2)]) Text Text AlwaysCache
52+ [(Oid 23 , Just n1), (Oid 23 , Just n2)] Text Text AlwaysCache
5453
5554fromRight :: Either e a -> a
5655fromRight (Right v) = v
@@ -108,12 +107,12 @@ testMultipleBatches = withConnection $ replicateM_ 10 . assertSingleBatch
108107-- | Query is empty string.
109108testEmptyQuery :: IO ()
110109testEmptyQuery = assertQueryNoData $
111- Query " " V. empty Text Text NeverCache
110+ Query " " [] Text Text NeverCache
112111
113112-- | Query than returns no datarows.
114113testQueryWithoutResult :: IO ()
115114testQueryWithoutResult = assertQueryNoData $
116- Query " SET client_encoding TO UTF8" V. empty Text Text NeverCache
115+ Query " SET client_encoding TO UTF8" [] Text Text NeverCache
117116
118117-- | Asserts that query returns no data rows.
119118assertQueryNoData :: Query -> IO ()
@@ -141,9 +140,9 @@ checkInvalidResult conn n = readNextData conn >>=
141140testInvalidBatch :: IO ()
142141testInvalidBatch = do
143142 let rightQuery = makeQuery1 " 5"
144- q1 = Query " SEL $1" ( V. fromList [(Oid 23 , Just " 5" )]) Text Text NeverCache
145- q2 = Query " SELECT $1" ( V. fromList [(Oid 23 , Just " a" )]) Text Text NeverCache
146- q4 = Query " SELECT $1" ( V. fromList [] ) Text Text NeverCache
143+ q1 = Query " SEL $1" [(Oid 23 , Just " 5" )] Text Text NeverCache
144+ q2 = Query " SELECT $1" [(Oid 23 , Just " a" )] Text Text NeverCache
145+ q4 = Query " SELECT $1" [] Text Text NeverCache
147146
148147 assertInvalidBatch " Parse error" [q1]
149148 assertInvalidBatch " Invalid param" [ q2]
@@ -162,7 +161,7 @@ testValidAfterError :: IO ()
162161testValidAfterError = withConnection $ \ c -> do
163162 let a = " 5"
164163 rightQuery = makeQuery1 a
165- invalidQuery = Query " SELECT $1" ( V. fromList [] ) Text Text NeverCache
164+ invalidQuery = Query " SELECT $1" [] Text Text NeverCache
166165 sendBatchAndSync c [invalidQuery]
167166 checkInvalidResult c 1
168167 waitReadyForQuery c
@@ -186,15 +185,15 @@ testDescribeStatement = withConnectionCommon $ \c -> do
186185testDescribeStatementNoData :: IO ()
187186testDescribeStatementNoData = withConnectionCommon $ \ c -> do
188187 r <- fromRight <$> describeStatement c " SET client_encoding TO UTF8"
189- assertBool " Should be empty" $ V. null (fst r)
190- assertBool " Should be empty" $ V. null (snd r)
188+ assertBool " Should be empty" $ null (fst r)
189+ assertBool " Should be empty" $ null (snd r)
191190
192191-- | Describes statement that is empty string.
193192testDescribeStatementEmpty :: IO ()
194193testDescribeStatementEmpty = withConnectionCommon $ \ c -> do
195194 r <- fromRight <$> describeStatement c " "
196- assertBool " Should be empty" $ V. null (fst r)
197- assertBool " Should be empty" $ V. null (snd r)
195+ assertBool " Should be empty" $ null (fst r)
196+ assertBool " Should be empty" $ null (snd r)
198197
199198-- | Query using simple query protocol.
200199testSimpleQuery :: IO ()
@@ -231,7 +230,7 @@ testPreparedStatementCache = withConnection $ \c -> do
231230-- | Test that large responses are properly handled
232231testLargeQuery :: IO ()
233232testLargeQuery = withConnection $ \ c -> do
234- sendBatchAndSync c [Query largeStmt V. empty Text Text NeverCache ]
233+ sendBatchAndSync c [Query largeStmt [] Text Text NeverCache ]
235234 r <- readNextData c
236235 waitReadyForQuery c
237236 assertBool " Should be Right" $ isRight r
@@ -243,7 +242,7 @@ testLargeQuery = withConnection $ \c -> do
243242testCorrectDatarows :: IO ()
244243testCorrectDatarows = withConnection $ \ c -> do
245244 let stmt = " SELECT * FROM generate_series(1, 1000)"
246- sendBatchAndSync c [Query stmt V. empty Text Text NeverCache ]
245+ sendBatchAndSync c [Query stmt [] Text Text NeverCache ]
247246 r <- readNextData c
248247 case r of
249248 Left e -> error $ show e
0 commit comments