Safe Haskell | None |
---|---|
Language | Haskell2010 |
- defaultPostgres :: Gargoyle ProcessHandle ByteString
- mkPostgresGargoyle :: FilePath -> FilePath -> (ProcessHandle -> IO ()) -> Gargoyle ProcessHandle ByteString
- initLocalPostgres :: FilePath -> FilePath -> IO ()
- getLocalPostgresConnectionString :: FilePath -> IO ByteString
- startLocalPostgres :: FilePath -> FilePath -> IO ProcessHandle
- shutdownPostgresSmart :: ProcessHandle -> IO ()
- shutdownPostgresFast :: ProcessHandle -> IO ()
- psqlLocal :: Gargoyle pid ByteString -> FilePath -> FilePath -> Maybe String -> IO ()
Documentation
defaultPostgres :: Gargoyle ProcessHandle ByteString Source #
A Gargoyle
that assumes initdb
and postgres
are in the path and
will perform a 'fast shutdown' on termination (see below).
:: FilePath | Path to |
-> FilePath | Path to |
-> (ProcessHandle -> IO ()) | Shutdown function |
-> Gargoyle ProcessHandle ByteString | The |
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
.
:: FilePath | Path to PostgreSQL |
-> FilePath | Path in which to initialize PostgreSQL Server |
-> IO () |
Create a new PostgreSQL database in a local folder. This is a low level function used to
define the PostgreSQL Gargoyle
.
getLocalPostgresConnectionString :: FilePath -> IO ByteString Source #
Produces the connection string for a local postgresql database. This is a low level function
used to define the PostgreSQL Gargoyle
:: FilePath | Path to PostgreSQL |
-> FilePath | Path where the server to start is located |
-> IO ProcessHandle | handle of the PostgreSQL server |
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
shutdownPostgresSmart Source #
:: ProcessHandle | handle of the PostgreSQL server |
-> IO () |
Perform a "Smart Shutdown" of Postgres; see http://www.postgresql.org/docs/current/static/server-shutdown.html
:: ProcessHandle | handle of the PostgreSQL server |
-> IO () |
Perform a "Fast Shutdown" of Postgres; see http://www.postgresql.org/docs/current/static/server-shutdown.html
:: Gargoyle pid ByteString |
|
-> FilePath | The path to |
-> FilePath | The path where the managed daemon is expected |
-> Maybe String | Optionally provide stdin input instead of an inheriting current stdin. It will have a newline and quit command appended to it. |
-> IO () |
Run psql
against a Gargoyle managed db.