gargantext-0.0.7.1.5.3: Search, map, share
Copyright(c) CNRS 2017-Present
LicenseAGPL + CECILL v3
Maintainerteam@gargantext.org
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageHaskell2010

Gargantext.Database.Prelude

Description

 
Synopsis

Documentation

class HasConnectionPool env where #

Methods

connPool :: Getter env (Pool Connection) #

Instances

Instances details
HasConnectionPool DevEnv # 
Instance details

Defined in Gargantext.API.Admin.EnvTypes

HasConnectionPool Env # 
Instance details

Defined in Gargantext.API.Admin.EnvTypes

HasConnectionPool (Pool Connection) # 
Instance details

Defined in Gargantext.Database.Prelude

class HasConfig env where #

Instances

Instances details
HasConfig DevEnv # 
Instance details

Defined in Gargantext.API.Admin.EnvTypes

HasConfig Env # 
Instance details

Defined in Gargantext.API.Admin.EnvTypes

HasConfig GargConfig # 
Instance details

Defined in Gargantext.Database.Prelude

type CmdM'' env err m = (MonadReader env m, MonadError err m, MonadBaseControl IO m, MonadRandom m) #

type CmdM' env err m = (MonadReader env m, MonadError err m, MonadBaseControl IO m) #

type DbCommon env = (HasConnectionPool env, HasConfig env) #

If possible, try to not add more constraints here. When performing a query/update on the DB, one shouldn't need more than being able to fetch from the underlying env the connection pool and access the GargConfig for some sensible defaults to store into the DB.

type CmdCommon env = (DbCommon env, HasConfig env, HasMail env, HasNLPServer env) #

type CmdM env err m = (CmdM' env err m, CmdCommon env) #

type CmdRandom env err m = (CmdM' env err m, DbCommon env, MonadRandom m, HasMail env) #

type Cmd'' env err a = forall m. CmdM'' env err m => m a #

type Cmd' env err a = forall m. CmdM' env err m => m a #

type Cmd err a = forall m env. CmdM env err m => m a #

type CmdR err a = forall m env. CmdRandom env err m => m a #

type DBCmd err a = forall m env. DbCmd' env err m => m a #

type DbCmd' env err m = (CmdM' env err m, DbCommon env) #

Only the minimum amount of class constraints required to use the Gargantext Database. It's important, to ease testability, that these constraints stays as few as possible.

mkCmd :: (Connection -> IO a) -> DBCmd err a #

runCmd :: HasConnectionPool env => env -> Cmd'' env err a -> IO (Either err a) #

runOpaQuery :: Default FromFields fields haskells => Select fields -> DBCmd err [haskells] #

runPGSQuery' :: (ToRow a, FromRow b) => Query -> a -> DBCmd err [b] #

runPGSQuery :: (FromRow r, ToRow q) => Query -> q -> DBCmd err [r] #

runPGSQuery_ :: FromRow r => Query -> DBCmd err [r] #

TODO catch error

execPGSQuery :: ToRow a => Query -> a -> DBCmd err Int64 #

restrictMaybe :: (Default IfPP b b, Default ToFields Bool b) => MaybeFields a -> (a -> b) -> b #