groundhog-postgresql-0.4.1: PostgreSQL backend for the groundhog library.

Safe HaskellNone

Database.Groundhog.Postgresql

Synopsis

Documentation

withPostgresqlPoolSource

Arguments

:: (MonadBaseControl IO m, MonadIO m) 
=> String

connection string

-> Int

number of connections to open

-> (Pool Postgresql -> m a) 
-> m a 

withPostgresqlConnSource

Arguments

:: (MonadBaseControl IO m, MonadIO m) 
=> String

connection string

-> (Postgresql -> m a) 
-> m a 

createPostgresqlPoolSource

Arguments

:: MonadIO m 
=> String

connection string

-> Int

number of connections to open

-> m (Pool Postgresql) 

runDbConn :: (MonadBaseControl IO m, MonadIO m, ConnectionManager cm conn) => DbPersist conn (NoLoggingT m) a -> cm -> m a

Runs action within connection. It can handle a simple connection, a pool of them, etc.

explicitType :: (Expression Postgresql r a, PersistField a) => a -> Expr Postgresql r aSource

Put explicit type for expression. It is useful for values which are defaulted to a wrong type. For example, a literal Int from a 64bit machine can be defaulted to a 32bit int by Postgresql. Also a value entered as an external string (geometry, arrays and other complex types have this representation) may need an explicit type.

castType :: Expression Postgresql r a => a -> String -> Expr Postgresql r aSource

Casts expression to a type. castType value "INT" results in value::INT.