-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Manage PostgreSQL servers with gargoyle -- -- This package provides tools for managing PostgreSQL servers that live -- in local folders and communicate via a Unix domain socket. It uses the -- gargoyle package in order to automatically initialize, spin up, -- and spin down such servers according to client demand. -- -- The `gargoyle-psql` executable is such a client which will try to -- connect to a PostgreSQL server at a given location: -- --
--   gargoyle-psql db
--   
-- --
--   psql (9.5.6)
--   Type "help" for help.
--   
--   postgres=#
--   
-- -- Note that `gargoyle-psql` assumes that PostgreSQL executables such as -- psql are available on the PATH. A custom Gargoyle is -- required to use non-standard PostgreSQL installations. -- -- The following is an example of using this package to run -- postgresql-simple actions using a local DB: -- --
--   import Database.PostgreSQL.Simple
--   import Gargoyle
--   import Gargoyle.PostgreSQL
--   
--   withDb :: String -> (Connection -> IO a) -> IO a
--   withDb dbPath a = withGargoyle defaultPostgres dbPath $ \dbUri -> a =<< connectPostgreSQL dbUri
--   
@package gargoyle-postgresql @version 0.1 module Gargoyle.PostgreSQL -- | A Gargoyle that assumes initdb and postgres -- are in the path and will perform a 'fast shutdown' on termination (see -- below). defaultPostgres :: Gargoyle ProcessHandle ByteString -- | Create a gargoyle by telling it where the relevant PostgreSQL -- executables are and what it should do in order to shut down the -- server. This module provides two options: shutdownPostgresSmart -- and shutdownPostgresFast. mkPostgresGargoyle :: FilePath -> FilePath -> (ProcessHandle -> IO ()) -> Gargoyle ProcessHandle ByteString -- | Create a new PostgreSQL database in a local folder. This is a low -- level function used to define the PostgreSQL Gargoyle. initLocalPostgres :: FilePath -> FilePath -> IO () -- | Produces the connection string for a local postgresql database. This -- is a low level function used to define the PostgreSQL Gargoyle getLocalPostgresConnectionString :: FilePath -> IO ByteString -- | Start a postgres server that is assumed to be in the given folder. -- This is a low level function used to define the PostgreSQL -- Gargoyle startLocalPostgres :: FilePath -> FilePath -> IO ProcessHandle -- | Perform a "Smart Shutdown" of Postgres; see -- http://www.postgresql.org/docs/current/static/server-shutdown.html shutdownPostgresSmart :: ProcessHandle -> IO () -- | Perform a "Fast Shutdown" of Postgres; see -- http://www.postgresql.org/docs/current/static/server-shutdown.html shutdownPostgresFast :: ProcessHandle -> IO () -- | Run psql against a Gargoyle managed db. psqlLocal :: Gargoyle pid ByteString -> FilePath -> FilePath -> Maybe String -> IO ()