mysql-simple-0.4.0.1: A mid-level MySQL client library.

Copyright(c) 2011 MailRank Inc.
LicenseBSD3
MaintainerPaul Rouse <pyr@doynton.org>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Database.MySQL.Simple.Param

Description

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

Synopsis

Documentation

data Action #

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

class Param a where #

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

Minimal complete definition

render

Methods

render :: a -> Action #

Prepare a value for substitution into a query string.

Instances

Param Bool # 

Methods

render :: Bool -> Action #

Param Double # 

Methods

render :: Double -> Action #

Param Float # 

Methods

render :: Float -> Action #

Param Int # 

Methods

render :: Int -> Action #

Param Int8 # 

Methods

render :: Int8 -> Action #

Param Int16 # 

Methods

render :: Int16 -> Action #

Param Int32 # 

Methods

render :: Int32 -> Action #

Param Int64 # 

Methods

render :: Int64 -> Action #

Param Integer # 

Methods

render :: Integer -> Action #

Param Word # 

Methods

render :: Word -> Action #

Param Word8 # 

Methods

render :: Word8 -> Action #

Param Word16 # 

Methods

render :: Word16 -> Action #

Param Word32 # 

Methods

render :: Word32 -> Action #

Param Word64 # 

Methods

render :: Word64 -> Action #

Param ByteString # 

Methods

render :: ByteString -> Action #

Param ByteString # 

Methods

render :: ByteString -> Action #

Param Text # 

Methods

render :: Text -> Action #

Param Text # 

Methods

render :: Text -> Action #

Param TimeOfDay # 

Methods

render :: TimeOfDay -> Action #

Param UTCTime # 

Methods

render :: UTCTime -> Action #

Param Day # 

Methods

render :: Day -> Action #

Param Null # 

Methods

render :: Null -> Action #

Param Action # 

Methods

render :: Action -> Action #

Param [Char] # 

Methods

render :: [Char] -> Action #

Param a => Param (Maybe a) # 

Methods

render :: Maybe a -> Action #

Param (Binary ByteString) # 
Param (Binary ByteString) # 
Param a => Param (VaArgs [a]) # 

Methods

render :: VaArgs [a] -> Action #

Param a => Param (In [a]) # 

Methods

render :: In [a] -> Action #

inQuotes :: Builder -> Builder #

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

This function does not perform any other escaping.