genesis-0.1.0.0: Opinionated bootstrapping for Haskell web services.

Safe HaskellNone
LanguageHaskell2010

Genesis.Persist.Base

Description

This module provides utilities for using PostgreSQL with Control.Monad.Persist and persistent.

Synopsis

Documentation

data PostgresOptions Source #

Connection options needed to connect to PostgreSQL. You can use postgresOptions to parse these options from the environment.

Constructors

PostgresOptions 

Fields

postgresOptions :: (AsEmpty e, AsUnread e, AsUnset e) => Parser e PostgresOptions Source #

An envparse Parser that parses PostgresOptions from the environment, looking for the environment variables PG_HOST, PG_PORT, PG_USER, PG_USER, PG_DB_NAME, and PG_PASSWORD. All of them are optional except for PG_DB_NAME.

withPostgresqlPool Source #

Arguments

:: (MonadBaseControl IO m, MonadLogger m) 
=> PostgresOptions

Options to connect to the database.

-> Int

Number of connections to be kept open in the pool.

-> (Pool SqlBackend -> m a)

Action to be executed that uses the connection pool.

-> m a