| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Test.Setup
Description
Schema setup, teardown, and connection helpers for the arbiter test suites.
Synopsis
- data SetupConfig = SetupConfig {}
- defaultSetupConfig :: SetupConfig
- setupDDL :: Text -> Text -> Connection -> IO ()
- setupDDLWithNotify :: Text -> Text -> Connection -> IO ()
- cleanupData :: Text -> Text -> Connection -> IO ()
- execute_ :: Connection -> Text -> IO ()
- execStatement :: MonadArbiter m => Text -> Params -> m Int64
- execQuery :: MonadArbiter m => Text -> Params -> RowCodec a -> m [a]
- setupOnce :: ByteString -> Text -> Text -> Bool -> IO ()
- addQueueTable :: ByteString -> Text -> Text -> Bool -> IO ()
- disableNoticeReporting :: Connection -> IO ()
- createSharedPool :: ByteString -> IO (Pool Connection)
- truncateToMicros :: UTCTime -> UTCTime
- seedConcurrencyPoolSQL :: Text -> Text -> Int32 -> [Text]
- drainWith :: IO [a] -> IO [a]
Documentation
Source #data SetupConfig
Configuration for test setup
Constructors
| SetupConfig | |
Fields
| |
Instances
| Eq SetupConfig Source # | |
Defined in Arbiter.Test.Setup | |
| Show SetupConfig Source # | |
Defined in Arbiter.Test.Setup Methods #showsPrec :: Int -> SetupConfig -> ShowS #show :: SetupConfig -> String #showList :: [SetupConfig] -> ShowS | |
Source #defaultSetupConfig :: SetupConfig
Default test setup configuration
Source #setupDDL :: Text -> Text -> Connection -> IO ()
Rebuild the schema without notification triggers.
Source #setupDDLWithNotify :: Text -> Text -> Connection -> IO ()
Rebuild the schema with notification triggers.
Source #cleanupData :: Text -> Text -> Connection -> IO ()
Truncate the queue's tables between tests.
Source #execute_ :: Connection -> Text -> IO ()
Run a statement with no parameters (test setup only).
Source #execStatement :: MonadArbiter m => Text -> Params -> m Int64
Run a pre-rendered statement with positional parameters (test setup only).
Source #execQuery :: MonadArbiter m => Text -> Params -> RowCodec a -> m [a]
Run a pre-rendered query with positional parameters and a decoder (test setup only).
Source #setupOnce :: ByteString -> Text -> Text -> Bool -> IO ()
Connect and rebuild the schema once, for a suite's outer bracket.
Source #addQueueTable :: ByteString -> Text -> Text -> Bool -> IO ()
Add one more job-queue table to an existing schema.
Source #disableNoticeReporting :: Connection -> IO ()
Silence libpq notice output for the connection.
Source #createSharedPool :: ByteString -> IO (Pool Connection)
A single-stripe pool of 5 connections for tests.
Source #truncateToMicros :: UTCTime -> UTCTime
Truncate to microsecond precision to match PostgreSQL timestamptz.