postgres-options-0.2.0.0: An Options type representing options for postgres connections

Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.Simple.Options

Description

A postgresql connection options type and related functions.

Synopsis

Documentation

data Options Source #

A postgresql connection options type.

Instances
Eq Options Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Options

Methods

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

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

Ord Options Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Options

Read Options Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Options

Show Options Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Options

Generic Options Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Options

Associated Types

type Rep Options :: Type -> Type #

Methods

from :: Options -> Rep Options x #

to :: Rep Options x -> Options #

Semigroup Options Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Options

Monoid Options Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Options

type Rep Options Source # 
Instance details

Defined in Database.PostgreSQL.Simple.Options

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

defaultOptions :: Options Source #

Default options.

  defaultOptions :: Options
  defaultOptions = mempty
   { host     = pure "localhost"
   , port     = pure 5432
   , user     = pure "postgres"
   , dbname   = pure "postgres"
   }

toConnectionString :: Options -> ByteString Source #

Make a key value postgresql option string.

parseConnectionString :: String -> Either String Options Source #

Parse a connection string. Can be in URI or keyword format.