Safe Haskell | None |
---|---|
Language | GHC2021 |
Synopsis
- newtype CreateQueryStats (bk :: k) = CreateQueryStats {
- queryStats :: QueryStats bk
- newtype HookQueryStats (bk :: k) = HookQueryStats {
- queryStats :: QueryStats bk
- data QueryStats (backend :: k) = QueryStats {
- rowsAffected :: !(Maybe Int64)
- time :: !(Maybe Int64)
- backend :: !(BackendQueryStats backend)
- class (Show (BackendQueryStats backend), Eq (BackendQueryStats backend), Monoid (BackendQueryStats backend), ToJSON (BackendQueryStats backend), FromJSON (BackendQueryStats backend)) => HasBackendQueryStats (backend :: k) where
- data BackendQueryStats (backend :: k)
- prettyPrint :: BackendQueryStats backend -> Maybe String
- 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
Documentation
newtype CreateQueryStats (bk :: k) #
Instances
newtype HookQueryStats (bk :: k) #
Instances
HasBackendQueryStats bk => Monoid (HookQueryStats bk) # | |||||
Defined in Napkin.Types.QueryStats mempty :: HookQueryStats bk # mappend :: HookQueryStats bk -> HookQueryStats bk -> HookQueryStats bk # mconcat :: [HookQueryStats bk] -> HookQueryStats bk # | |||||
HasBackendQueryStats bk => Semigroup (HookQueryStats bk) # | |||||
Defined in Napkin.Types.QueryStats (<>) :: HookQueryStats bk -> HookQueryStats bk -> HookQueryStats bk # sconcat :: NonEmpty (HookQueryStats bk) -> HookQueryStats bk # stimes :: Integral b => b -> HookQueryStats bk -> HookQueryStats bk # | |||||
Generic (HookQueryStats bk) # | |||||
Defined in Napkin.Types.QueryStats
from :: HookQueryStats bk -> Rep (HookQueryStats bk) x # to :: Rep (HookQueryStats bk) x -> HookQueryStats bk # | |||||
Show (QueryStats bk) => Show (HookQueryStats bk) # | |||||
Defined in Napkin.Types.QueryStats showsPrec :: Int -> HookQueryStats bk -> ShowS # show :: HookQueryStats bk -> String # showList :: [HookQueryStats bk] -> ShowS # | |||||
Eq (QueryStats bk) => Eq (HookQueryStats bk) # | |||||
Defined in Napkin.Types.QueryStats (==) :: HookQueryStats bk -> HookQueryStats bk -> Bool # (/=) :: HookQueryStats bk -> HookQueryStats bk -> Bool # | |||||
type Rep (HookQueryStats bk) # | |||||
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.
QueryStats | |
|
Instances
HasBackendQueryStats backend => LocalQueryStats (backend :: k) (ReaderT (IORef (QueryStats backend)) (KatipT IO)) # | |||||
Defined in Napkin.Run.Base tellStats :: QueryStats backend -> ReaderT (IORef (QueryStats backend)) (KatipT IO) () # | |||||
HasBackendQueryStats backend => Monoid (QueryStats backend) # | |||||
Defined in Napkin.Types.QueryStats mempty :: QueryStats backend # mappend :: QueryStats backend -> QueryStats backend -> QueryStats backend # mconcat :: [QueryStats backend] -> QueryStats backend # | |||||
HasBackendQueryStats backend => Semigroup (QueryStats backend) # | |||||
Defined in Napkin.Types.QueryStats (<>) :: QueryStats backend -> QueryStats backend -> QueryStats backend # sconcat :: NonEmpty (QueryStats backend) -> QueryStats backend # stimes :: Integral b => b -> QueryStats backend -> QueryStats backend # | |||||
Generic (QueryStats backend) # | |||||
Defined in Napkin.Types.QueryStats
from :: QueryStats backend -> Rep (QueryStats backend) x # to :: Rep (QueryStats backend) x -> QueryStats backend # | |||||
Show (BackendQueryStats bk) => Show (QueryStats bk) # | |||||
Defined in Napkin.Types.QueryStats showsPrec :: Int -> QueryStats bk -> ShowS # show :: QueryStats bk -> String # showList :: [QueryStats bk] -> ShowS # | |||||
Eq (BackendQueryStats bk) => Eq (QueryStats bk) # | |||||
Defined in Napkin.Types.QueryStats (==) :: QueryStats bk -> QueryStats bk -> Bool # (/=) :: QueryStats bk -> QueryStats bk -> Bool # | |||||
type Rep (QueryStats backend) # | |||||
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 #
Nothing
data BackendQueryStats (backend :: k) #
prettyPrint :: BackendQueryStats backend -> Maybe String #
Instances
HasBackendQueryStats BigQuery # | |||||
Defined in Napkin.Run.BigQuery
| |||||
HasBackendQueryStats MsSql # | |||||
Defined in Napkin.Run.MsSql
| |||||
HasBackendQueryStats Postgres # | |||||
Defined in Napkin.Run.Postgres
| |||||
HasBackendQueryStats Redshift # | |||||
Defined in Napkin.Run.Redshift
| |||||
HasBackendQueryStats Sqlite # | |||||
Defined in Napkin.Run.Sqlite
|
prettyQueryStats :: forall {k} (backend :: k). HasBackendQueryStats backend => QueryStats backend -> String #
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 #