Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Freckle.App.Database
Description
Database access for your App
Synopsis
- class HasSqlPool app where
- getSqlPool :: app -> SqlPool
- type SqlPool = Pool SqlBackend
- makePostgresPool :: (MonadUnliftIO m, MonadLoggerIO m) => m SqlPool
- makePostgresPoolWith :: (MonadUnliftIO m, MonadLoggerIO m) => PostgresConnectionConf -> m SqlPool
- runDB :: (MonadUnliftIO m, MonadTracer m, MonadReader app m, HasSqlPool app, HasStatsClient app) => SqlPersistT m a -> m a
- runDBSimple :: (HasSqlPool app, MonadUnliftIO m, MonadReader app m) => SqlPersistT m a -> m a
- data PostgresConnectionConf = PostgresConnectionConf {}
- data PostgresPasswordSource
- data PostgresPassword
- data PostgresStatementTimeout
- postgresStatementTimeoutMilliseconds :: PostgresStatementTimeout -> Int
- envParseDatabaseConf :: PostgresPasswordSource -> Parser Error PostgresConnectionConf
- envPostgresPasswordSource :: Parser Error PostgresPasswordSource
Documentation
class HasSqlPool app where Source #
Methods
getSqlPool :: app -> SqlPool Source #
Instances
HasSqlPool SqlPool Source # | |
Defined in Freckle.App.Database Methods getSqlPool :: SqlPool -> SqlPool Source # | |
HasSqlPool site => HasSqlPool (HandlerData child site) Source # | |
Defined in Freckle.App.Database Methods getSqlPool :: HandlerData child site -> SqlPool Source # |
type SqlPool = Pool SqlBackend Source #
makePostgresPool :: (MonadUnliftIO m, MonadLoggerIO m) => m SqlPool Source #
makePostgresPoolWith :: (MonadUnliftIO m, MonadLoggerIO m) => PostgresConnectionConf -> m SqlPool Source #
runDB :: (MonadUnliftIO m, MonadTracer m, MonadReader app m, HasSqlPool app, HasStatsClient app) => SqlPersistT m a -> m a Source #
Run a Database action with connection stats and tracing
runDBSimple :: (HasSqlPool app, MonadUnliftIO m, MonadReader app m) => SqlPersistT m a -> m a Source #
data PostgresConnectionConf Source #
Constructors
PostgresConnectionConf | |
Fields
|
Instances
Show PostgresConnectionConf Source # | |
Defined in Freckle.App.Database Methods showsPrec :: Int -> PostgresConnectionConf -> ShowS # show :: PostgresConnectionConf -> String # showList :: [PostgresConnectionConf] -> ShowS # | |
Eq PostgresConnectionConf Source # | |
Defined in Freckle.App.Database Methods (==) :: PostgresConnectionConf -> PostgresConnectionConf -> Bool # (/=) :: PostgresConnectionConf -> PostgresConnectionConf -> Bool # |
data PostgresPasswordSource Source #
Instances
Show PostgresPasswordSource Source # | |
Defined in Freckle.App.Database Methods showsPrec :: Int -> PostgresPasswordSource -> ShowS # show :: PostgresPasswordSource -> String # showList :: [PostgresPasswordSource] -> ShowS # | |
Eq PostgresPasswordSource Source # | |
Defined in Freckle.App.Database Methods (==) :: PostgresPasswordSource -> PostgresPasswordSource -> Bool # (/=) :: PostgresPasswordSource -> PostgresPasswordSource -> Bool # |
data PostgresPassword Source #
Constructors
PostgresPasswordIamAuth | |
PostgresPasswordStatic String |
Instances
Show PostgresPassword Source # | |
Defined in Freckle.App.Database Methods showsPrec :: Int -> PostgresPassword -> ShowS # show :: PostgresPassword -> String # showList :: [PostgresPassword] -> ShowS # | |
Eq PostgresPassword Source # | |
Defined in Freckle.App.Database Methods (==) :: PostgresPassword -> PostgresPassword -> Bool # (/=) :: PostgresPassword -> PostgresPassword -> Bool # |
data PostgresStatementTimeout Source #
Instances
Show PostgresStatementTimeout Source # | |
Defined in Freckle.App.Database Methods showsPrec :: Int -> PostgresStatementTimeout -> ShowS # show :: PostgresStatementTimeout -> String # showList :: [PostgresStatementTimeout] -> ShowS # | |
Eq PostgresStatementTimeout Source # | |
Defined in Freckle.App.Database Methods (==) :: PostgresStatementTimeout -> PostgresStatementTimeout -> Bool # (/=) :: PostgresStatementTimeout -> PostgresStatementTimeout -> Bool # |