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

CopyrightDaan Leijen (c) 1999, daan@cs.uu.nl HWT Group (c) 2003, haskelldb-users@lists.sourceforge.net
LicenseBSD-style
Maintainerhaskelldb-users@lists.sourceforge.net
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell98

Database.HaskellDB.Sql.Default

Contents

Description

Default SQL generation.

Synopsis

Documentation

defaultSqlQuery :: SqlGenerator -> PrimQuery -> SqlSelect Source

Creates a SqlSelect based on the PrimQuery supplied. Corresponds to the SQL statement SELECT.

defaultSqlUpdate Source

Arguments

:: SqlGenerator 
-> TableName

Name of the table to update.

-> [PrimExpr]

Conditions which must all be true for a row to be updated.

-> Assoc

Update the data with this.

-> SqlUpdate 

Creates a SqlUpdate. Corresponds to the SQL statement UPDATE which updates data in a table.

defaultSqlDelete Source

Arguments

:: SqlGenerator 
-> TableName

Name of the table

-> [PrimExpr]

Criteria which must all be true for a row to be deleted.

-> SqlDelete 

Creates a SqlDelete. Corresponds to the SQL statement DELETE which deletes rows in a table.

defaultSqlInsert Source

Arguments

:: SqlGenerator 
-> TableName

Name of the table

-> Assoc

What to insert.

-> SqlInsert 

Creates a SqlInsert.

defaultSqlInsertQuery Source

Arguments

:: SqlGenerator 
-> TableName

Name of the table

-> PrimQuery

What to insert

-> SqlInsert 

Creates a SqlInsert. Corresponds to the SQL statement INSERT INTO which is used to insert new rows in a table.

defaultSqlCreateDB Source

Arguments

:: SqlGenerator 
-> String

name of the database.

-> SqlCreate 

Use this to create a SqlCreate data type corresponding to the SQL statement CREATE DATABASE which creates a new database.

defaultSqlCreateTable Source

Arguments

:: SqlGenerator 
-> TableName

name of the table to be created.

-> [(Attribute, FieldDesc)]

Column descriptions

-> SqlCreate 

Use this to create a SqlCreate data type corresponding to the SQL statement CREATE which creates a new table.

defaultSqlDropDB :: SqlGenerator -> String -> SqlDrop Source

Creates a SqlDrop that delete the database with the name given as the first argument.

defaultSqlDropTable :: SqlGenerator -> TableName -> SqlDrop Source

Creates a SqlDrop that delete the database named in the first argument.

defaultSqlGroup :: SqlGenerator -> Assoc -> SqlSelect -> SqlSelect Source

Ensures the groupby value on the SqlSelect either preserves existing grouping or that it will group on all columns (i.e, Mark == All).

Utilities

toSqlSelect :: SqlSelect -> SqlSelect Source

Make sure our SqlSelect statement is really a SqlSelect and not another constructor.