Safe Haskell | None |
---|---|
Language | Haskell2010 |
Backend abstractions for YeshQL.
Synopsis
- data YeshBackend = YeshBackend {
- ybNames :: ParsedQuery -> ([Name], [PatQ], String, TypeQ)
- ybMkQueryBody :: ParsedQuery -> Q Exp
- data YeshImpl = YeshImpl {}
- foldYeshImpls :: [YeshImpl] -> YeshImpl
- class Yesh a where
- class YeshFile a where
- yeshAllWith :: YeshBackend -> Either ParsedQuery [ParsedQuery] -> YeshImpl
- describeBackend :: YeshBackend
- docBackend :: YeshBackend
Documentation
data YeshBackend Source #
A backend provides just the information required to build query functions from a parsed query.
YeshBackend | |
|
A YeshQL implementation. From this, we can build both TH splices and quasiquoters.
foldYeshImpls :: [YeshImpl] -> YeshImpl Source #
We want to be able to call the yesh
family of functions in both QQ and
TH contexts, so unfortunately we need some typeclass polymorphism.
yeshWith :: YeshBackend -> a Source #
yesh1With :: YeshBackend -> a Source #
Instances
Yesh QuasiQuoter Source # | |
Defined in Database.YeshQL.Backend yeshWith :: YeshBackend -> QuasiQuoter Source # yesh1With :: YeshBackend -> QuasiQuoter Source # | |
Yesh (String -> Q [Dec]) Source # | |
Defined in Database.YeshQL.Backend | |
Yesh (String -> Q Exp) Source # | |
Defined in Database.YeshQL.Backend |
class YeshFile a where Source #
yeshFileWith :: YeshBackend -> a Source #
yesh1FileWith :: YeshBackend -> a Source #
Instances
YeshFile QuasiQuoter Source # | |
Defined in Database.YeshQL.Backend | |
YeshFile (String -> Q [Dec]) Source # | |
Defined in Database.YeshQL.Backend yeshFileWith :: YeshBackend -> String -> Q [Dec] Source # yesh1FileWith :: YeshBackend -> String -> Q [Dec] Source # | |
YeshFile (String -> Q Exp) Source # | |
Defined in Database.YeshQL.Backend yeshFileWith :: YeshBackend -> String -> Q Exp Source # yesh1FileWith :: YeshBackend -> String -> Q Exp Source # |
yeshAllWith :: YeshBackend -> Either ParsedQuery [ParsedQuery] -> YeshImpl Source #
This is where much of the magic happens: this function asks the backend
for some building blocks, and assembles a YeshImpl
of the provided query
or queries.