Portability | portable |
---|---|
Stability | experimental |
Maintainer | Leon P Smith <leon@melding-monads.com> |
Safe Haskell | Safe-Infered |
Database.PostgreSQL.Simple.ToField
Description
The ToField
typeclass, for rendering a parameter to a SQL query.
- data Action
- = Plain Builder
- | Escape ByteString
- | EscapeBytea ByteString
- | Many [Action]
- class ToField a where
- inQuotes :: Builder -> Builder
Documentation
How to render an element when substituting it into a query.
Constructors
Plain Builder | Render without escaping or quoting. Use for non-text types
such as numbers, when you are certain that they will not
introduce formatting vulnerabilities via use of characters such
as spaces or " |
Escape ByteString | Escape and enclose in quotes before substituting. Use for all text-like types, and anything else that may contain unsafe characters when rendered. |
EscapeBytea ByteString | Escape binary data for use as a |
Many [Action] | Concatenate a series of rendering actions. |
A type that may be used as a single parameter to a SQL query.
Instances