napkin-spec-2.0.0
Safe HaskellNone
LanguageGHC2024

Napkin.Types.QueryStats

Synopsis

Documentation

data QueryStats (backend :: k) #

Used for aggregate statistics gathered from running queries.

Constructors

QueryStats 

Fields

Instances

Instances details
HasBackendQueryStats backend => LocalQueryStats (backend :: k) (ReaderT (IORef (QueryStats backend)) (KatipT IO)) # 
Instance details

Defined in Napkin.Run.Base

Methods

tellStats :: QueryStats backend -> ReaderT (IORef (QueryStats backend)) (KatipT IO) () #

ToJSON (BackendQueryStats bk) => ToJSON (QueryStats bk) # 
Instance details

Defined in Napkin.Types.QueryStats

HasBackendQueryStats backend => Monoid (QueryStats backend) # 
Instance details

Defined in Napkin.Types.QueryStats

Methods

mempty :: QueryStats backend #

mappend :: QueryStats backend -> QueryStats backend -> QueryStats backend #

mconcat :: [QueryStats backend] -> QueryStats backend #

HasBackendQueryStats backend => Semigroup (QueryStats backend) # 
Instance details

Defined in Napkin.Types.QueryStats

Methods

(<>) :: QueryStats backend -> QueryStats backend -> QueryStats backend #

sconcat :: NonEmpty (QueryStats backend) -> QueryStats backend #

stimes :: Integral b => b -> QueryStats backend -> QueryStats backend #

Generic (QueryStats backend) # 
Instance details

Defined in Napkin.Types.QueryStats

Associated Types

type Rep (QueryStats backend) 
Instance details

Defined in Napkin.Types.QueryStats

type Rep (QueryStats backend) = D1 ('MetaData "QueryStats" "Napkin.Types.QueryStats" "napkin-spec-2.0.0-7NH5JHRFo7V8BQP5NCfMo1" 'False) (C1 ('MetaCons "QueryStats" 'PrefixI 'True) (S1 ('MetaSel ('Just "rowsAffected") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Int64)) :*: S1 ('MetaSel ('Just "backend") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (BackendQueryStats backend))))

Methods

from :: QueryStats backend -> Rep (QueryStats backend) x #

to :: Rep (QueryStats backend) x -> QueryStats backend #

Show (BackendQueryStats bk) => Show (QueryStats bk) # 
Instance details

Defined in Napkin.Types.QueryStats

Methods

showsPrec :: Int -> QueryStats bk -> ShowS #

show :: QueryStats bk -> String #

showList :: [QueryStats bk] -> ShowS #

Eq (BackendQueryStats bk) => Eq (QueryStats bk) # 
Instance details

Defined in Napkin.Types.QueryStats

Methods

(==) :: QueryStats bk -> QueryStats bk -> Bool #

(/=) :: QueryStats bk -> QueryStats bk -> Bool #

type Rep (QueryStats backend) # 
Instance details

Defined in Napkin.Types.QueryStats

type Rep (QueryStats backend) = D1 ('MetaData "QueryStats" "Napkin.Types.QueryStats" "napkin-spec-2.0.0-7NH5JHRFo7V8BQP5NCfMo1" 'False) (C1 ('MetaCons "QueryStats" 'PrefixI 'True) (S1 ('MetaSel ('Just "rowsAffected") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Int64)) :*: S1 ('MetaSel ('Just "backend") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (BackendQueryStats backend))))

class (ToJSON (BackendQueryStats backend), Show (BackendQueryStats backend), Eq (BackendQueryStats backend), Monoid (BackendQueryStats backend), ToJSON (BackendQueryStats backend)) => HasBackendQueryStats (backend :: k) where #

Minimal complete definition

Nothing

Associated Types

data BackendQueryStats (backend :: k) #

prettyQueryStats :: forall {k} (backend :: k). HasBackendQueryStats backend => QueryStats backend -> Text #

type StatsM (b :: k) = ReaderT (IORef (QueryStats b)) (KatipT IO) #

runStatsWith :: forall {k} (b :: k) a m. (MonadIO m, HasBackendQueryStats b) => LogEnv -> StatsM b a -> m (a, QueryStats b) #

runNoStats :: forall {k} (b :: k) a m. (MonadIO m, HasBackendQueryStats b) => LogEnv -> KatipT IO a -> m a #