haskelldb-2.2.1: A library of combinators for generating and executing SQL statements.

Portabilitynon-portable
Stabilityexperimental
Maintainerhaskelldb-users@lists.sourceforge.net
Safe HaskellNone

Database.HaskellDB.Sql

Description

A data type for SQL.

Synopsis

Documentation

type SqlTable = StringSource

type SqlColumn = StringSource

type SqlName = StringSource

A valid SQL name for a parameter.

data SqlOrder Source

Constructors

SqlAsc 
SqlDesc 

Instances

Show SqlOrder 

data SqlType Source

Constructors

SqlType String 
SqlType1 String Int 
SqlType2 String Int Int 

Instances

Show SqlType 

data SqlSelect Source

Data type for SQL SELECT statements.

Constructors

SqlSelect 

Fields

options :: [String]

DISTINCT, ALL etc.

attrs :: [(SqlColumn, SqlExpr)]

result

tables :: [(SqlTable, SqlSelect)]

FROM

criteria :: [SqlExpr]

WHERE

groupby :: Maybe Mark

GROUP BY

orderby :: [(SqlExpr, SqlOrder)]

ORDER BY

extra :: [String]

TOP n, etc.

SqlBin String SqlSelect SqlSelect

Binary relational operator

SqlTable SqlTable

Select a whole table.

SqlEmpty

Empty select.

Instances

Show SqlSelect 

data SqlUpdate Source

Data type for SQL UPDATE statements.

data SqlDelete Source

Data type for SQL DELETE statements.

Constructors

SqlDelete SqlTable [SqlExpr] 

data SqlInsert Source

Data type for SQL INSERT statements.

data SqlCreate Source

Data type for SQL CREATE statements.

Constructors

SqlCreateDB String

Create a database

SqlCreateTable SqlTable [(SqlColumn, (SqlType, Bool))]

Create a table.

data SqlDrop Source

Data type representing the SQL DROP statement.

Constructors

SqlDropDB String

Delete a database

SqlDropTable SqlTable

Delete a table named SqlTable

data SqlExpr Source

Expressions in SQL statements.

Instances

Show SqlExpr 

data Mark Source

Constructors

All 
Columns [(SqlColumn, SqlExpr)] 

Instances

Show Mark 

foldSqlExpr :: (SqlColumn -> t, String -> t -> t -> t, String -> t -> t, String -> t -> t, String -> [t] -> t, String -> [t] -> t, String -> t, [(t, t)] -> t -> t, [t] -> t, SqlSelect -> t, Maybe SqlName -> t -> t, t, t -> t, String -> t -> t) -> SqlExpr -> tSource

Transform a SqlExpr value.

foldSqlSelect :: ([String] -> [(SqlColumn, SqlExpr)] -> [(SqlTable, t)] -> [SqlExpr] -> Maybe Mark -> [(SqlExpr, SqlOrder)] -> [String] -> t, String -> t -> t -> t, SqlTable -> t, t) -> SqlSelect -> tSource

Transform a SqlSelect value.