Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides functions to consume data types that represent database queries (e.g. ReadRequest, MutateRequest) and SqlFragment to produce SqlQuery type outputs.
Synopsis
- readRequestToQuery :: ReadRequest -> Snippet
- mutateRequestToQuery :: MutateRequest -> Snippet
- readRequestToCountQuery :: ReadRequest -> Snippet
- requestToCallProcQuery :: QualifiedIdentifier -> [PgArg] -> Maybe PayloadJSON -> Bool -> Maybe PreferParameters -> [FieldName] -> Snippet
- limitedQuery :: Snippet -> Maybe Integer -> Snippet
Documentation
readRequestToCountQuery :: ReadRequest -> Snippet Source #
SQL query meant for COUNTing the root node of the Tree. It only takes WHERE into account and doesn't include LIMIT/OFFSET because it would reduce the COUNT. SELECT 1 is done instead of SELECT * to prevent doing expensive operations(like functions based on the columns) inside the FROM target.
requestToCallProcQuery :: QualifiedIdentifier -> [PgArg] -> Maybe PayloadJSON -> Bool -> Maybe PreferParameters -> [FieldName] -> Snippet Source #