-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Types for easy adding postgresql configuration to your program -- -- Types for easy adding postgresql configuration to your program @package postgresql-config @version 0.1.0 module Database.PostgreSQL.Config -- | Configuration parsed from json or yaml file, or obtained by any other -- way. Example configuration yml is: -- --
-- database: "dbname" -- host: "127.0.0.1" # optional -- port: "5432" # optional -- user: "dbuser" -- password: "pass" -- poolsize: "10" # optional maximum connections in pool -- pooltimeout: "60" # optional minimum connection lifetime -- poolstripes: "1" # optional count of stripes in pool --data PostgresConf PostgresConf :: ByteString -> Int -> NominalDiffTime -> Int -> PostgresConf -- | The connection string. [pgConnStr] :: PostgresConf -> ByteString -- | How many connections should be held on the connection pool. [pgPoolSize] :: PostgresConf -> Int -- | Timeout to stay connection active [pgPoolTimeout] :: PostgresConf -> NominalDiffTime -- | Stripes in the pool [pgPoolStripes] :: PostgresConf -> Int -- | Connection pool. Must be created from settings using -- createPGPool newtype PGPool PGPool :: (Pool Connection) -> PGPool [unPGPool] :: PGPool -> (Pool Connection) -- | Create pool from parsed configuration createPGPool :: PostgresConf -> IO PGPool type PGCallback = Connection -> IO () -- | Create pool from parsed configuration, which enables to fire a -- callback after creating each connection. createPGPoolWithCallback :: PostgresConf -> PGCallback -> IO PGPool -- | Force to create at least one connection in pool. Usefull to check -- connection settings at program start time pingPGPool :: PGPool -> IO () -- | Combinator for simple implementation of withPGConnection -- method from package postgresql-query. Typical usage is: -- --
-- instance HasPostgres (HandlerT App IO) where -- withPGConnection = withPGPool appPGPool --withPGPool :: (MonadReader site m, MonadBaseControl IO m) => (site -> PGPool) -> (Connection -> m a) -> m a -- | Another combinator to implement withPGConnection -- --
-- instance HasPostgres (OurMonadT IO) where -- withPGConnection = withPGPoolPrim $ getPGPool <$> getSomeThing --withPGPoolPrim :: (MonadBaseControl IO m) => m PGPool -> (Connection -> m a) -> m a instance GHC.Generics.Selector Database.PostgreSQL.Config.S1_0_0PGPool instance GHC.Generics.Constructor Database.PostgreSQL.Config.C1_0PGPool instance GHC.Generics.Datatype Database.PostgreSQL.Config.D1PGPool instance GHC.Show.Show Database.PostgreSQL.Config.PostgresConf instance GHC.Classes.Eq Database.PostgreSQL.Config.PostgresConf instance GHC.Classes.Ord Database.PostgreSQL.Config.PostgresConf instance GHC.Generics.Generic Database.PostgreSQL.Config.PGPool instance GHC.Show.Show Database.PostgreSQL.Config.PGPool instance Data.Aeson.Types.Class.FromJSON Database.PostgreSQL.Config.PostgresConf