postgresql-simple-opts-0.3.0.0: An optparse-applicative parser for postgresql-simple's connection options

Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.Simple.Options

Description

A resuable optparse-applicative parser for creating a postgresql-simple Connection

Synopsis

Documentation

data Options Source #

Instances

Eq Options Source # 

Methods

(==) :: Options -> Options -> Bool #

(/=) :: Options -> Options -> Bool #

Ord Options Source # 
Read Options Source # 
Show Options Source # 
Generic Options Source # 

Associated Types

type Rep Options :: * -> * #

Methods

from :: Options -> Rep Options x #

to :: Rep Options x -> Options #

type Rep Options Source # 
type Rep Options = D1 (MetaData "Options" "Database.PostgreSQL.Simple.Options" "postgresql-simple-opts-0.3.0.0-HS7R0QBIdejI80jHjnWJRs" False) (C1 (MetaCons "Options" PrefixI True) ((:*:) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "oHost") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String))) (S1 (MetaSel (Just Symbol "oHostaddr") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String)))) ((:*:) (S1 (MetaSel (Just Symbol "oPort") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Int))) ((:*:) (S1 (MetaSel (Just Symbol "oUser") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String))) (S1 (MetaSel (Just Symbol "oPassword") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String)))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "oDbname") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)) ((:*:) (S1 (MetaSel (Just Symbol "oConnectTimeout") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Int))) (S1 (MetaSel (Just Symbol "oClientEncoding") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String))))) ((:*:) (S1 (MetaSel (Just Symbol "oOptions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String))) ((:*:) (S1 (MetaSel (Just Symbol "oFallbackApplicationName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String))) (S1 (MetaSel (Just Symbol "oKeepalives") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Int))))))) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "oKeepalivesIdle") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Int))) ((:*:) (S1 (MetaSel (Just Symbol "oKeepalivesCount") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Int))) (S1 (MetaSel (Just Symbol "oSslmode") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String))))) ((:*:) (S1 (MetaSel (Just Symbol "oRequiressl") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Int))) ((:*:) (S1 (MetaSel (Just Symbol "oSslcompression") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Int))) (S1 (MetaSel (Just Symbol "oSslcert") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String)))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "oSslkey") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String))) ((:*:) (S1 (MetaSel (Just Symbol "oSslrootcert") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String))) (S1 (MetaSel (Just Symbol "oRequirepeer") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String))))) ((:*:) (S1 (MetaSel (Just Symbol "oKrbsrvname") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String))) ((:*:) (S1 (MetaSel (Just Symbol "oGsslib") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String))) (S1 (MetaSel (Just Symbol "oService") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String)))))))))

data PartialOptions Source #

An optional version of Options. This includes an instance of | ParseRecord which provides the optparse-applicative Parser.

Instances

Eq PartialOptions Source # 
Ord PartialOptions Source # 
Read PartialOptions Source # 
Show PartialOptions Source # 
Generic PartialOptions Source # 

Associated Types

type Rep PartialOptions :: * -> * #

Monoid PartialOptions Source # 
Default PartialOptions Source #

The PartialOptions version of defaultOptions

Methods

def :: PartialOptions #

ParseRecord PartialOptions Source # 
type Rep PartialOptions Source # 
type Rep PartialOptions = D1 (MetaData "PartialOptions" "Database.PostgreSQL.Simple.Options" "postgresql-simple-opts-0.3.0.0-HS7R0QBIdejI80jHjnWJRs" False) (C1 (MetaCons "PartialOptions" PrefixI True) ((:*:) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "host") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last String))) (S1 (MetaSel (Just Symbol "hostaddr") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last String)))) ((:*:) (S1 (MetaSel (Just Symbol "port") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last Int))) ((:*:) (S1 (MetaSel (Just Symbol "user") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last String))) (S1 (MetaSel (Just Symbol "password") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last String)))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "dbname") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last String))) ((:*:) (S1 (MetaSel (Just Symbol "connectTimeout") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last Int))) (S1 (MetaSel (Just Symbol "clientEncoding") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last String))))) ((:*:) (S1 (MetaSel (Just Symbol "options") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last String))) ((:*:) (S1 (MetaSel (Just Symbol "fallbackApplicationName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last String))) (S1 (MetaSel (Just Symbol "keepalives") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last Int))))))) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "keepalivesIdle") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last Int))) ((:*:) (S1 (MetaSel (Just Symbol "keepalivesCount") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last Int))) (S1 (MetaSel (Just Symbol "sslmode") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last String))))) ((:*:) (S1 (MetaSel (Just Symbol "requiressl") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last Int))) ((:*:) (S1 (MetaSel (Just Symbol "sslcompression") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last Int))) (S1 (MetaSel (Just Symbol "sslcert") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last String)))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "sslkey") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last String))) ((:*:) (S1 (MetaSel (Just Symbol "sslrootcert") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last String))) (S1 (MetaSel (Just Symbol "requirepeer") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last String))))) ((:*:) (S1 (MetaSel (Just Symbol "krbsrvname") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last String))) ((:*:) (S1 (MetaSel (Just Symbol "gsslib") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last String))) (S1 (MetaSel (Just Symbol "service") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Last String)))))))))

mkLast :: a -> Last a Source #

getLast' :: Applicative f => Last a -> f (Maybe a) Source #

completeParser :: Parser Options Source #

Useful for testing or if only Options are needed.

run :: Options -> IO Connection Source #

Create a connection with an Option