mysql-simple-0.4.9: A mid-level MySQL client library.
Copyright(c) 2011 MailRank Inc.
LicenseBSD3
MaintainerPaul Rouse <pyr@doynton.org>
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Database.MySQL.Simple.Param

Description

The Param typeclass, for rendering a parameter to a SQL query.

Synopsis

Documentation

data Action Source #

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.

Many [Action]

Concatenate a series of rendering actions.

Instances

Instances details
Show Action Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Param Action Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Action -> Action Source #

class ToField a where Source #

A type that can be converted to a ByteString for use as a parameter to an SQL query.

Any type which is an instance of this class can use the default implementation of Param, which will wrap encodings with Escape.

Since: 0.4.8

Methods

toField :: a -> ByteString Source #

class Param a where Source #

A type that may be used as a single parameter to a SQL query.

A default implementation is provided for any type which is an instance of ToField, providing a simple mechanism for user-defined encoding to text- or blob-like fields (including JSON).

Minimal complete definition

Nothing

Methods

render :: a -> Action Source #

Prepare a value for substitution into a query string.

default render :: ToField a => a -> Action Source #

Instances

Instances details
Param Int16 Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Int16 -> Action Source #

Param Int32 Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Int32 -> Action Source #

Param Int64 Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Int64 -> Action Source #

Param Int8 Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Int8 -> Action Source #

Param Word16 Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Word16 -> Action Source #

Param Word32 Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Word32 -> Action Source #

Param Word64 Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Word64 -> Action Source #

Param ByteString Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Param ByteString Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Param Action Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Action -> Action Source #

Param Null Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Null -> Action Source #

Param Text Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Text -> Action Source #

Param Text Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Text -> Action Source #

Param Day Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Day -> Action Source #

Param UTCTime Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Param TimeOfDay Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Param Word8 Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Word8 -> Action Source #

Param Integer Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Param Bool Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Bool -> Action Source #

Param Double Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Double -> Action Source #

Param Float Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Float -> Action Source #

Param Int Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Int -> Action Source #

Param Word Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Word -> Action Source #

Param (Binary ByteString) Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Param (Binary ByteString) Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Param a => Param (In (Set a)) Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: In (Set a) -> Action Source #

Param a => Param (In [a]) Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: In [a] -> Action Source #

Param a => Param (VaArgs [a]) Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: VaArgs [a] -> Action Source #

Param a => Param (Maybe a) Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: Maybe a -> Action Source #

Param [Char] Source # 
Instance details

Defined in Database.MySQL.Simple.Param

Methods

render :: [Char] -> Action Source #

inQuotes :: Builder -> Builder Source #

Surround a string with single-quote characters: "'"

This function does not perform any other escaping.