| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Database.Postgres.Temp.Internal
Synopsis
- getFreePort :: IO Int
- waitForDB :: String -> IO ()
- data DB = DB {}
- data SocketClass
- start :: [(String, String)] -> IO (Either StartError DB)
- startLocalhost :: [(String, String)] -> IO (Either StartError DB)
- fourth :: (a, b, c, d) -> d
- procWith :: Handle -> Handle -> String -> [String] -> CreateProcess
- config :: Maybe FilePath -> String
- data StartError
- throwIfError :: (ExitCode -> StartError) -> ExitCode -> IO ()
- pidString :: ProcessHandle -> IO String
- runProcessWith :: Handle -> Handle -> String -> String -> [String] -> IO ExitCode
- startWithHandles :: SocketClass -> [(String, String)] -> Handle -> Handle -> IO (Either StartError DB)
- startWithHandlesAndDir :: SocketClass -> [(String, String)] -> FilePath -> Handle -> Handle -> IO (Either StartError DB)
- data Event
- rmDirIgnoreErrors :: FilePath -> IO ()
- startWithLogger :: (Event -> IO ()) -> SocketClass -> [(String, String)] -> FilePath -> Handle -> Handle -> IO (Either StartError DB)
- startAndLogToTmp :: [(String, String)] -> IO (Either StartError DB)
- terminateConnections :: DB -> IO ()
- stop :: DB -> IO ExitCode
Documentation
getFreePort :: IO Int Source #
Constructors
| DB | |
Fields
| |
data SocketClass Source #
Instances
start postgres and use the current processes stdout and stderr
start postgres and use the current processes stdout and stderr but use TCP on localhost instead of a unix socket.
data StartError Source #
Constructors
| InitDBFailed ExitCode | |
| CreateDBFailed [String] ExitCode |
Instances
| Eq StartError Source # | |
Defined in Database.Postgres.Temp.Internal | |
| Show StartError Source # | |
Defined in Database.Postgres.Temp.Internal Methods showsPrec :: Int -> StartError -> ShowS # show :: StartError -> String # showList :: [StartError] -> ShowS # | |
| Exception StartError Source # | |
Defined in Database.Postgres.Temp.Internal Methods toException :: StartError -> SomeException # fromException :: SomeException -> Maybe StartError # displayException :: StartError -> String # | |
throwIfError :: (ExitCode -> StartError) -> ExitCode -> IO () Source #
Arguments
| :: SocketClass | |
| -> [(String, String)] | Extra options which override the defaults |
| -> Handle | stdout |
| -> Handle | stderr |
| -> IO (Either StartError DB) |
Start postgres and pass in handles for stdout and stderr
startWithHandlesAndDir :: SocketClass -> [(String, String)] -> FilePath -> Handle -> Handle -> IO (Either StartError DB) Source #
Constructors
| InitDB | |
| WriteConfig | |
| FreePort | |
| StartPostgres | |
| WaitForDB | |
| CreateDB | |
| Finished |
rmDirIgnoreErrors :: FilePath -> IO () Source #
startWithLogger :: (Event -> IO ()) -> SocketClass -> [(String, String)] -> FilePath -> Handle -> Handle -> IO (Either StartError DB) Source #
terminateConnections :: DB -> IO () Source #
Force all connections to the database to close. Can be useful in some testing situations. Called during shutdown as well.