Safe Haskell | None |
---|---|
Language | Haskell2010 |
Any function that outputs a SqlFragment should be in this module.
Synopsis
- noLocationF :: SqlFragment
- type SqlFragment = ByteString
- asBinaryF :: FieldName -> SqlFragment
- asCsvF :: SqlFragment
- asJsonF :: Bool -> SqlFragment
- asJsonSingleF :: Bool -> SqlFragment
- countF :: Snippet -> Bool -> (Snippet, SqlFragment)
- fromQi :: QualifiedIdentifier -> SqlFragment
- ftsOperators :: HashMap Text SqlFragment
- jsonPlaceHolder :: Maybe ByteString -> Snippet
- limitOffsetF :: NonnegRange -> Snippet
- locationF :: [Text] -> SqlFragment
- normalizedBody :: Maybe ByteString -> Snippet
- operators :: HashMap Text SqlFragment
- pgFmtColumn :: QualifiedIdentifier -> Text -> SqlFragment
- pgFmtIdent :: Text -> SqlFragment
- pgFmtJoinCondition :: JoinCondition -> Snippet
- pgFmtLogicTree :: QualifiedIdentifier -> LogicTree -> Snippet
- pgFmtOrderTerm :: QualifiedIdentifier -> OrderTerm -> Snippet
- pgFmtSelectItem :: QualifiedIdentifier -> SelectItem -> Snippet
- responseHeadersF :: PgVersion -> SqlFragment
- responseStatusF :: PgVersion -> SqlFragment
- returningF :: QualifiedIdentifier -> [FieldName] -> SqlFragment
- selectBody :: SqlFragment
- sourceCTEName :: SqlFragment
- unknownEncoder :: ByteString -> Snippet
- intercalateSnippet :: ByteString -> [Snippet] -> Snippet
Documentation
type SqlFragment = ByteString Source #
A part of a SQL query that cannot be executed independently
asBinaryF :: FieldName -> SqlFragment Source #
asCsvF :: SqlFragment Source #
asJsonF :: Bool -> SqlFragment Source #
asJsonSingleF :: Bool -> SqlFragment Source #
jsonPlaceHolder :: Maybe ByteString -> Snippet Source #
Equivalent to "$1::json" | TODO: At this stage there shouldn't be a Maybe since ApiRequest should ensure that an INSERT/UPDATE has a body
limitOffsetF :: NonnegRange -> Snippet Source #
locationF :: [Text] -> SqlFragment Source #
normalizedBody :: Maybe ByteString -> Snippet Source #
These CTEs convert a json object into a json array, this way we can use json_populate_recordset for all json payloads Otherwise we'd have to use json_populate_record for json objects and json_populate_recordset for json arrays We do this in SQL to avoid processing the JSON in application code
pgFmtColumn :: QualifiedIdentifier -> Text -> SqlFragment Source #
pgFmtIdent :: Text -> SqlFragment Source #
pgFmtLogicTree :: QualifiedIdentifier -> LogicTree -> Snippet Source #
pgFmtOrderTerm :: QualifiedIdentifier -> OrderTerm -> Snippet Source #
returningF :: QualifiedIdentifier -> [FieldName] -> SqlFragment Source #
unknownEncoder :: ByteString -> Snippet Source #
intercalateSnippet :: ByteString -> [Snippet] -> Snippet Source #