napkin-1.0.0
Safe HaskellNone
LanguageGHC2021

Napkin.Run.Effects.Interceptors.TryParseRawQueries

Synopsis

Documentation

data Replacer (m :: k) a where #

Constructors

TryParseQuery :: forall {k} (m :: k). Query -> Replacer m (Query, Set (Ref Table)) 

Instances

Instances details
GEq (Replacer a :: Type -> Type) # 
Instance details

Defined in Napkin.Run.Effects.Interceptors.TryParseRawQueries

Methods

geq :: Replacer a a0 -> Replacer a b -> Maybe (a0 :~: b) #

GShow (Replacer a :: Type -> Type) # 
Instance details

Defined in Napkin.Run.Effects.Interceptors.TryParseRawQueries

Methods

gshowsPrec :: Int -> Replacer a a0 -> ShowS #

Show (Replacer m a) # 
Instance details

Defined in Napkin.Run.Effects.Interceptors.TryParseRawQueries

Methods

showsPrec :: Int -> Replacer m a -> ShowS #

show :: Replacer m a -> String #

showList :: [Replacer m a] -> ShowS #

Eq (Replacer m a) # 
Instance details

Defined in Napkin.Run.Effects.Interceptors.TryParseRawQueries

Methods

(==) :: Replacer m a -> Replacer m a -> Bool #

(/=) :: Replacer m a -> Replacer m a -> Bool #

tryParseQuery :: forall (r :: EffectRow). Member (Replacer :: (Type -> Type) -> Type -> Type) r => Query -> Sem r (Query, Set (Ref Table)) #

interceptSqlReadTryParseRawQueries :: forall {k} (b :: k) (r :: EffectRow) a. Members '[SqlRead b :: (Type -> Type) -> Type -> Type, SqlParse :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type, Output ExtraDependencies :: (Type -> Type) -> Type -> Type, Replacer :: (Type -> Type) -> Type -> Type] r => Sem r a -> Sem r a #

Parse top level QueryRaw instances and replace them with 'Query.'

TODO: This can only handle top level raw queries. What if raw queries appear deep within non-raw queries? We'd need a monadic interleaving traversal to reach all such cases and parse them.

interceptSqlWriteTryParseRawQueries :: forall b (r :: EffectRow) a. Members '[SqlWrite b :: (Type -> Type) -> Type -> Type, Output ExtraDependencies :: (Type -> Type) -> Type -> Type, Replacer :: (Type -> Type) -> Type -> Type] r => Sem r a -> Sem r a #

replacer :: forall (r :: EffectRow) a. Members '[Replacer :: (Type -> Type) -> Type -> Type, Output ExtraDependencies :: (Type -> Type) -> Type -> Type] r => Query -> (Query -> Sem r a) -> Sem r a #

interpretReplacer :: forall {k} (r :: EffectRow) (m :: k) a. Members '[SqlParse :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type] r => Replacer m a -> Sem r a #

interceptTryParseRawQueries :: forall b (r :: EffectRow) a. Members '[SqlRead b :: (Type -> Type) -> Type -> Type, SqlParse :: (Type -> Type) -> Type -> Type, SqlWrite b :: (Type -> Type) -> Type -> Type, Log :: (Type -> Type) -> Type -> Type, Output ExtraDependencies :: (Type -> Type) -> Type -> Type] r => Sem r a -> Sem r a #