Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- defaultPostgres :: Gargoyle FilePath ByteString
- mkPostgresGargoyle :: FilePath -> (FilePath -> FilePath -> IO ()) -> Gargoyle FilePath ByteString
- initLocalPostgres :: FilePath -> FilePath -> IO ()
- getLocalPostgresConnectionString :: FilePath -> IO ByteString
- startLocalPostgres :: FilePath -> FilePath -> IO FilePath
- shutdownPostgresSmart :: FilePath -> FilePath -> IO ()
- shutdownPostgresFast :: FilePath -> FilePath -> IO ()
- shutdownPostgresImmediate :: FilePath -> FilePath -> IO ()
- shutdownPostgresWithMode :: String -> FilePath -> FilePath -> IO ()
- psqlLocal :: Gargoyle pid ByteString -> FilePath -> FilePath -> Maybe String -> IO ()
- runPgLocalWithSubstitution :: Gargoyle pid ByteString -> FilePath -> FilePath -> (String -> [String]) -> Maybe String -> IO ExitCode
Documentation
defaultPostgres :: Gargoyle FilePath 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 -> FilePath -> IO ()) | Shutdown function |
-> Gargoyle FilePath 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 FilePath | 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 #
:: FilePath | Path to PostgreSQL |
-> FilePath | Path where the server to start is located |
-> IO () |
Perform a "Smart Shutdown" of Postgres; see http://www.postgresql.org/docs/current/static/server-shutdown.html
:: FilePath | Path to PostgreSQL |
-> FilePath | Path where the server to start is located |
-> IO () |
Perform a "Fast Shutdown" of Postgres; see http://www.postgresql.org/docs/current/static/server-shutdown.html
shutdownPostgresImmediate Source #
:: FilePath | Path to PostgreSQL |
-> FilePath | Path where the server to start is located |
-> IO () |
Perform a "Immediate Shutdown" of Postgres; see http://www.postgresql.org/docs/current/static/server-shutdown.html
shutdownPostgresWithMode Source #
:: String | The shutdown mode to execute; see https://www.postgresql.org/docs/9.5/app-pg-ctl.html |
-> FilePath | Path to PostgreSQL |
-> FilePath | Path where the server to start is located |
-> IO () |
:: 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.
runPgLocalWithSubstitution Source #
:: Gargoyle pid ByteString |
|
-> FilePath | The path where the managed daemon is expected |
-> FilePath | Path to process to run |
-> (String -> [String]) | Function producing arguments to the process given the connection string |
-> Maybe String | Optionally provide stdin input instead of an inheriting current stdin. |
-> IO ExitCode |
Run an arbitrary process against a Gargoyle-managed DB, providing connection information by substituting a given argument pattern with the connection string.