napkin-0.5.13
Safe HaskellNone
LanguageHaskell2010

Napkin.Run.Effects.Interceptors.TryParseRawQueries

Synopsis

Documentation

data Replacer m a where #

Constructors

TryParseQuery :: Query -> Replacer m (Query, Set (Ref Table)) 

Instances

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

Defined in Napkin.Run.Effects.Interceptors.TryParseRawQueries

Methods

gshowsPrec :: forall (a0 :: k). Int -> Replacer a a0 -> ShowS #

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

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 #

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 #

type DefiningModule (Replacer :: k -> Type -> Type) # 
Instance details

Defined in Napkin.Run.Effects.Interceptors.TryParseRawQueries

type DefiningModule (Replacer :: k -> Type -> Type) = "Napkin.Run.Effects.Interceptors.TryParseRawQueries"

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.