| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Database.YeshQL.Backend
Description
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.
Constructors
| YeshBackend | |
Fields
| |
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.
Instances
| Yesh QuasiQuoter Source # | |
Defined in Database.YeshQL.Backend Methods 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 #
Minimal complete definition
Instances
| YeshFile QuasiQuoter Source # | |
Defined in Database.YeshQL.Backend Methods | |
| YeshFile (String -> Q [Dec]) Source # | |
Defined in Database.YeshQL.Backend Methods yeshFileWith :: YeshBackend -> String -> Q [Dec] Source # yesh1FileWith :: YeshBackend -> String -> Q [Dec] Source # | |
| YeshFile (String -> Q Exp) Source # | |
Defined in Database.YeshQL.Backend Methods 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.