mysql-simple-0.4.5: 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 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.

class Param a where Source #

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

Minimal complete definition

render

Methods

render :: a -> Action Source #

Prepare a value for substitution into a query string.

Instances

Param Bool Source # 

Methods

render :: Bool -> Action Source #

Param Double Source # 

Methods

render :: Double -> Action Source #

Param Float Source # 

Methods

render :: Float -> Action Source #

Param Int Source # 

Methods

render :: Int -> Action Source #

Param Int8 Source # 

Methods

render :: Int8 -> Action Source #

Param Int16 Source # 

Methods

render :: Int16 -> Action Source #

Param Int32 Source # 

Methods

render :: Int32 -> Action Source #

Param Int64 Source # 

Methods

render :: Int64 -> Action Source #

Param Integer Source # 
Param Word Source # 

Methods

render :: Word -> Action Source #

Param Word8 Source # 

Methods

render :: Word8 -> Action Source #

Param Word16 Source # 

Methods

render :: Word16 -> Action Source #

Param Word32 Source # 

Methods

render :: Word32 -> Action Source #

Param Word64 Source # 

Methods

render :: Word64 -> Action Source #

Param ByteString Source # 
Param ByteString Source # 
Param Text Source # 

Methods

render :: Text -> Action Source #

Param Text Source # 

Methods

render :: Text -> Action Source #

Param TimeOfDay Source # 
Param UTCTime Source # 
Param Day Source # 

Methods

render :: Day -> Action Source #

Param Null Source # 

Methods

render :: Null -> Action Source #

Param Action Source # 

Methods

render :: Action -> Action Source #

Param [Char] Source # 

Methods

render :: [Char] -> Action Source #

Param a => Param (Maybe a) Source # 

Methods

render :: Maybe a -> Action Source #

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

Methods

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

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

Methods

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

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

Methods

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

inQuotes :: Builder -> Builder Source #

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

This function does not perform any other escaping.