napkin-1.0.0
Safe HaskellNone
LanguageGHC2021

Napkin.Types.QueryStats

Synopsis

Documentation

newtype CreateQueryStats (bk :: k) #

Constructors

CreateQueryStats 

Fields

Instances

Instances details
HasBackendQueryStats bk => Monoid (CreateQueryStats bk) # 
Instance details

Defined in Napkin.Types.QueryStats

HasBackendQueryStats bk => Semigroup (CreateQueryStats bk) # 
Instance details

Defined in Napkin.Types.QueryStats

Generic (CreateQueryStats bk) # 
Instance details

Defined in Napkin.Types.QueryStats

Associated Types

type Rep (CreateQueryStats bk) 
Instance details

Defined in Napkin.Types.QueryStats

type Rep (CreateQueryStats bk) = D1 ('MetaData "CreateQueryStats" "Napkin.Types.QueryStats" "napkin-1.0.0-5YkWAC9Wc776PT0LDghaFb" 'True) (C1 ('MetaCons "CreateQueryStats" 'PrefixI 'True) (S1 ('MetaSel ('Just "queryStats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (QueryStats bk))))
Show (QueryStats bk) => Show (CreateQueryStats bk) # 
Instance details

Defined in Napkin.Types.QueryStats

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

Defined in Napkin.Types.QueryStats

type Rep (CreateQueryStats bk) # 
Instance details

Defined in Napkin.Types.QueryStats

type Rep (CreateQueryStats bk) = D1 ('MetaData "CreateQueryStats" "Napkin.Types.QueryStats" "napkin-1.0.0-5YkWAC9Wc776PT0LDghaFb" 'True) (C1 ('MetaCons "CreateQueryStats" 'PrefixI 'True) (S1 ('MetaSel ('Just "queryStats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (QueryStats bk))))

newtype HookQueryStats (bk :: k) #

Constructors

HookQueryStats 

Fields

Instances

Instances details
HasBackendQueryStats bk => Monoid (HookQueryStats bk) # 
Instance details

Defined in Napkin.Types.QueryStats

HasBackendQueryStats bk => Semigroup (HookQueryStats bk) # 
Instance details

Defined in Napkin.Types.QueryStats

Generic (HookQueryStats bk) # 
Instance details

Defined in Napkin.Types.QueryStats

Associated Types

type Rep (HookQueryStats bk) 
Instance details

Defined in Napkin.Types.QueryStats

type Rep (HookQueryStats bk) = D1 ('MetaData "HookQueryStats" "Napkin.Types.QueryStats" "napkin-1.0.0-5YkWAC9Wc776PT0LDghaFb" 'True) (C1 ('MetaCons "HookQueryStats" 'PrefixI 'True) (S1 ('MetaSel ('Just "queryStats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (QueryStats bk))))

Methods

from :: HookQueryStats bk -> Rep (HookQueryStats bk) x #

to :: Rep (HookQueryStats bk) x -> HookQueryStats bk #

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

Defined in Napkin.Types.QueryStats

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

Defined in Napkin.Types.QueryStats

type Rep (HookQueryStats bk) # 
Instance details

Defined in Napkin.Types.QueryStats

type Rep (HookQueryStats bk) = D1 ('MetaData "HookQueryStats" "Napkin.Types.QueryStats" "napkin-1.0.0-5YkWAC9Wc776PT0LDghaFb" 'True) (C1 ('MetaCons "HookQueryStats" 'PrefixI 'True) (S1 ('MetaSel ('Just "queryStats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (QueryStats bk))))

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) () #

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-1.0.0-5YkWAC9Wc776PT0LDghaFb" 'False) (C1 ('MetaCons "QueryStats" 'PrefixI 'True) (S1 ('MetaSel ('Just "rowsAffected") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Int64)) :*: (S1 ('MetaSel ('Just "time") '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-1.0.0-5YkWAC9Wc776PT0LDghaFb" 'False) (C1 ('MetaCons "QueryStats" 'PrefixI 'True) (S1 ('MetaSel ('Just "rowsAffected") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Int64)) :*: (S1 ('MetaSel ('Just "time") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Int64)) :*: S1 ('MetaSel ('Just "backend") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (BackendQueryStats backend)))))

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

Minimal complete definition

Nothing

Associated Types

data BackendQueryStats (backend :: k) #

Instances

Instances details
HasBackendQueryStats BigQuery # 
Instance details

Defined in Napkin.Run.BigQuery

Associated Types

data BackendQueryStats BigQuery 
Instance details

Defined in Napkin.Run.BigQuery

HasBackendQueryStats MsSql # 
Instance details

Defined in Napkin.Run.MsSql

Associated Types

data BackendQueryStats MsSql 
Instance details

Defined in Napkin.Run.MsSql

HasBackendQueryStats Postgres # 
Instance details

Defined in Napkin.Run.Postgres

Associated Types

data BackendQueryStats Postgres 
Instance details

Defined in Napkin.Run.Postgres

HasBackendQueryStats Redshift # 
Instance details

Defined in Napkin.Run.Redshift

Associated Types

data BackendQueryStats Redshift 
Instance details

Defined in Napkin.Run.Redshift

HasBackendQueryStats Sqlite # 
Instance details

Defined in Napkin.Run.Sqlite

Associated Types

data BackendQueryStats Sqlite 
Instance details

Defined in Napkin.Run.Sqlite

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

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 #