Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- newtype CreateQueryStats bk = CreateQueryStats {
- unCreateQueryStats :: QueryStats bk
- newtype HookQueryStats bk = HookQueryStats {
- unHookQueryStats :: QueryStats bk
- data QueryStats backend = QueryStats {
- _queryStats_rowsAffected :: !(Maybe Int64)
- _queryStats_time :: !(Maybe Int64)
- _queryStats_backend :: !(BackendQueryStats backend)
- class (Show (BackendQueryStats backend), Eq (BackendQueryStats backend), Monoid (BackendQueryStats backend), ToJSON (BackendQueryStats backend), FromJSON (BackendQueryStats backend)) => HasBackendQueryStats backend where
- data BackendQueryStats backend :: Type
- prettyPrint :: BackendQueryStats backend -> Maybe String
- prettyQueryStats :: HasBackendQueryStats backend => QueryStats backend -> String
- type StatsM b = ReaderT (IORef (QueryStats b)) (KatipT IO)
- runStatsWith :: forall b a m. (MonadIO m, HasBackendQueryStats b) => LogEnv -> StatsM b a -> m (a, QueryStats b)
- runNoStats :: forall b a m. (MonadIO m, HasBackendQueryStats b) => LogEnv -> KatipT IO a -> m a
Documentation
newtype CreateQueryStats bk #
Instances
HasBackendQueryStats bk => Monoid (CreateQueryStats bk) # | |
Defined in Napkin.Types.QueryStats mempty :: CreateQueryStats bk # mappend :: CreateQueryStats bk -> CreateQueryStats bk -> CreateQueryStats bk # mconcat :: [CreateQueryStats bk] -> CreateQueryStats bk # | |
HasBackendQueryStats bk => Semigroup (CreateQueryStats bk) # | |
Defined in Napkin.Types.QueryStats (<>) :: CreateQueryStats bk -> CreateQueryStats bk -> CreateQueryStats bk # sconcat :: NonEmpty (CreateQueryStats bk) -> CreateQueryStats bk # stimes :: Integral b => b -> CreateQueryStats bk -> CreateQueryStats bk # | |
Show (QueryStats bk) => Show (CreateQueryStats bk) # | |
Defined in Napkin.Types.QueryStats showsPrec :: Int -> CreateQueryStats bk -> ShowS # show :: CreateQueryStats bk -> String # showList :: [CreateQueryStats bk] -> ShowS # | |
Eq (QueryStats bk) => Eq (CreateQueryStats bk) # | |
Defined in Napkin.Types.QueryStats (==) :: CreateQueryStats bk -> CreateQueryStats bk -> Bool # (/=) :: CreateQueryStats bk -> CreateQueryStats bk -> Bool # |
newtype HookQueryStats bk #
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 # | |
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 # |
data QueryStats backend #
Used for aggregate statistics gathered from running queries.
QueryStats | |
|
Instances
class (Show (BackendQueryStats backend), Eq (BackendQueryStats backend), Monoid (BackendQueryStats backend), ToJSON (BackendQueryStats backend), FromJSON (BackendQueryStats backend)) => HasBackendQueryStats backend where #
Nothing
data BackendQueryStats backend :: Type #
prettyPrint :: BackendQueryStats backend -> Maybe String #
Instances
HasBackendQueryStats BigQuery # | |
Defined in Napkin.Run.BigQuery data BackendQueryStats BigQuery # | |
HasBackendQueryStats MsSql # | |
Defined in Napkin.Run.MsSql data BackendQueryStats MsSql # | |
HasBackendQueryStats Postgres # | |
Defined in Napkin.Run.Postgres data BackendQueryStats Postgres # | |
HasBackendQueryStats Redshift # | |
Defined in Napkin.Run.Redshift data BackendQueryStats Redshift # | |
HasBackendQueryStats Sqlite # | |
Defined in Napkin.Run.Sqlite data BackendQueryStats Sqlite # |
prettyQueryStats :: HasBackendQueryStats backend => QueryStats backend -> String #
runStatsWith :: forall b a m. (MonadIO m, HasBackendQueryStats b) => LogEnv -> StatsM b a -> m (a, QueryStats b) #
runNoStats :: forall b a m. (MonadIO m, HasBackendQueryStats b) => LogEnv -> KatipT IO a -> m a #