napkin-0.5.14
Safe HaskellSafe-Inferred
LanguageGHC2021

Napkin.Run.Effects.Interceptors.TryParseRawQueries

Synopsis

Documentation

data Replacer m a where #

Constructors

TryParseQuery :: 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 :: forall (a0 :: k) (b :: k). 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 :: forall (a0 :: k). 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. Member Replacer r => Query -> Sem r (Query, Set (Ref Table)) #

interceptSqlReadTryParseRawQueries :: forall b r a. Members [SqlRead b, SqlParse, Log, Output ExtraDependencies, Replacer] 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.