hipsql-api-0.0.0.0
Safe HaskellNone
LanguageHaskell2010

Hipsql.API.Internal

Description

Internal module which implements the hipsql HTTP API using servant.

Synopsis

Disclaimer

Changes to this module will not be reflected in the library's version updates.

Internals

newtype Version Source #

Used to show version information for a hipsql server or client.

Constructors

Version 

Fields

Instances

Instances details
Eq Version Source # 
Instance details

Defined in Hipsql.API.Internal

Methods

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

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

Generic Version Source # 
Instance details

Defined in Hipsql.API.Internal

Associated Types

type Rep Version :: Type -> Type #

Methods

from :: Version -> Rep Version x #

to :: Rep Version x -> Version #

ToJSON Version Source # 
Instance details

Defined in Hipsql.API.Internal

FromJSON Version Source # 
Instance details

Defined in Hipsql.API.Internal

type Rep Version Source # 
Instance details

Defined in Hipsql.API.Internal

type Rep Version = D1 ('MetaData "Version" "Hipsql.API.Internal" "hipsql-api-0.0.0.0-inplace" 'True) (C1 ('MetaCons "Version" 'PrefixI 'True) (S1 ('MetaSel ('Just "version") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Int])))

lookupHipsqlPort :: IO (Either String Int) Source #

Lookup the HTTP port to use for a hipsql HTTP server or client by checking the HIPSQL_PORT environment variable. Defaults to defaultHipsqlPort if unset.

defaultHipsqlPort :: Int Source #

By default, hipsql should use the port 55805.

lookupEnvInt :: String -> IO (Maybe (Either String Int)) Source #

Lookup an environment variable and parse it as an Int.

withDefault :: IO (Maybe a) -> a -> IO a Source #

Used in conjunction with lookupEnvInt to set a default value.

mkVersion :: Version -> Version Source #

Constructs a Version from a Paths_hipsql_*.version value.