module Pqi.Conformance.Operation.SendDescribePrepared
( spec,
)
where
import qualified Pqi
import Pqi.Conformance.Harness
import Pqi.Conformance.Prelude
import Pqi.Conformance.Scenario (drainResults)
import Test.Hspec
spec :: Pqi.Adapter -> SpecWith ByteString
spec :: Adapter -> SpecWith ByteString
spec Adapter
adapter =
String -> SpecWith ByteString -> SpecWith ByteString
forall a. HasCallStack => String -> SpecWith a -> SpecWith a
describe String
"sendDescribePrepared" do
String
-> (ByteString -> IO ()) -> SpecWith (Arg (ByteString -> IO ()))
forall a.
(HasCallStack, Example a) =>
String -> a -> SpecWith (Arg a)
it String
"describes a prepared statement asynchronously" \ByteString
conninfo ->
Adapter
-> ByteString
-> (Connection -> IO (Bool, [ResultObservation]))
-> IO ()
forall a.
(Eq a, Show a, HasCallStack) =>
Adapter -> ByteString -> (Connection -> IO a) -> IO ()
differential Adapter
adapter ByteString
conninfo \Connection
connection -> do
_ <- Connection -> ByteString -> ByteString -> Maybe [Word32] -> IO Bool
Pqi.sendPrepare Connection
connection ByteString
"conformance_send_desc" ByteString
"select $1 :: int4 * 2" Maybe [Word32]
forall a. Maybe a
Nothing
_ <- drainResults connection
sent <- Pqi.sendDescribePrepared connection "conformance_send_desc"
results <- drainResults connection
pure (sent, results)