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

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

Database.HaskellDB.Sql

Description

A data type for SQL.

Synopsis

Documentation

type SqlName = StringSource

A valid SQL name for a parameter.

data SqlOrder Source

Constructors

SqlAsc 
SqlDesc 

Instances

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

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 Mark Source

Constructors

All 
Columns [(SqlColumn, SqlExpr)] 

Instances

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.