postgresql-typed-0.6.1.0: PostgreSQL interface with compile-time SQL type checking, optional HDBC backend

Copyright2016 Dylan Simon
Safe HaskellSafe
LanguageHaskell98

Database.PostgreSQL.Typed.SQLToken

Description

Parsing of SQL statements to safely identify placeholders. Supports both dollar-placeholders and question marks for HDBC.

Synopsis

Documentation

data SQLToken Source #

A parsed SQL token.

Constructors

SQLToken String

Raw (non-markup) SQL string

SQLParam Int

A "$N" parameter placeholder (this is the only non-string-preserving token: "$012" becomes "$12")

SQLExpr String

A "${expr}" expression placeholder

SQLQMark Bool

A possibly-escaped question-mark: False for "?" or True for "\?"

Instances
Eq SQLToken Source # 
Instance details

Defined in Database.PostgreSQL.Typed.SQLToken

Show SQLToken Source #

Produces the original SQL string

Instance details

Defined in Database.PostgreSQL.Typed.SQLToken

IsString SQLToken Source # 
Instance details

Defined in Database.PostgreSQL.Typed.SQLToken

sqlTokens :: String -> [SQLToken] Source #

Parse a SQL string into a series of tokens. The showList implementation for SQLToken inverts this sequence back to a SQL string.