-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Library for easily running embedded PostgreSQL server for tests.
--
-- Library for easily running embedded PostgreSQL server for tests. It
-- downloads, runs, checks and stops PostgreSQL Database instance for
-- you.
@package postgres-embedded
@version 0.2.0
-- | Library for easily running embedded PostgreSQL server for tests
module Database.PostgreSQL.Embedded
-- | Starts PostgreSQL instance with given config.
--
-- Returns RuntimeConfig that is required for
-- stopPostgres.
startPostgres :: StartupConfig -> DBConfig -> IO RuntimeConfig
-- | Stops PostgreSQL instance.
--
-- Doesn't remove data directory.
stopPostgres :: RuntimeConfig -> IO ()
-- | Version of PostgreSQL distribution See
-- https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
-- for supported versions
newtype Version
Version :: String -> Version
[value] :: Version -> String
-- | Type of operation system Doesn't really work for Windows now
data Os
Win :: Os
OSX :: Os
Linux :: Os
-- | Config for stating up instance Note that startup requeres clean or
-- non-existing directory
data StartupConfig
StartupConfig :: Bool -> Version -> Bool -> StartupConfig
-- | Should data directory be cleaned up?
[cleanDir] :: StartupConfig -> Bool
-- | See Version
[version] :: StartupConfig -> Version
-- | Silence the output of PG commands
[silent] :: StartupConfig -> Bool
-- | Config of running instance
data RuntimeConfig
RuntimeConfig :: FilePath -> FilePath -> Bool -> RuntimeConfig
-- | Path of extracter PostgreSQL distribution
[execDir] :: RuntimeConfig -> FilePath
-- | Data directory
[dataDir] :: RuntimeConfig -> FilePath
[silentR] :: RuntimeConfig -> Bool
-- | Database config
data DBConfig
DBConfig :: Integer -> String -> DBConfig
-- | Port
[port] :: DBConfig -> Integer
-- | Username
[username] :: DBConfig -> String