|
| Database.HaskellDB.Sql | | Portability | non-portable | | Stability | experimental | | Maintainer | dp03-7@mdstud.chalmers.se |
|
|
|
|
|
| Description |
Transform a PrimQuery (relational expression) to SQL
and pretty print SQL
$Revision: 1.22 $
|
|
| Synopsis |
|
|
|
|
| Type Declarations
|
|
| data SqlSelect |
| Data type representing the SQL SELECT statement.
Can be created with the toSql function', and pretty printed
with the ppSql function.
| | Constructors | |
|
|
| data SqlUpdate |
| Data type representing the SQL UPDATE statement.
Can be created with the toUpdate function, and pretty printed with
the ppUpdate function.
| | Constructors | | SqlUpdate TableName [String] [String] | Update
the rows in table TableName that corresponds to the criterias
supplid with the second field with values from the last field.
|
|
|
|
| data SqlDelete |
| Data type representing the SQL DELETE statement.
Can be created with the toDelete function, and pretty printed with
the ppDelete function.
| | Constructors | | SqlDelete TableName [String] | Delete the rows
in the table TableName that corresponds to the criterias
supplied as a list of strings in the last field.
|
|
|
|
| data SqlInsert |
| Data type representing the SQL INSERT statement.
| | Constructors | |
|
|
| Function Declarations
|
|
| toSql :: PrimQuery -> SqlSelect |
| Creates a SqlSelect based on the PrimQuery supplied.
Corresponds to the SQL statement SELECT.
|
|
| ppSql :: SqlSelect -> Doc |
| Pretty prints a SqlSelect
|
|
| toUpdate |
| :: TableName | Name of the table to update.
| | -> [PrimExpr] | Which data to update.
| | -> Assoc | Update the data with this.
| | -> SqlUpdate | | | Creates a SqlUpdate. Corresponds to the SQL statement
UPDATE which updates data in a table.
|
|
|
| ppUpdate :: SqlUpdate -> Doc |
| Pretty prints a SqlUpdate
|
|
| toDelete |
|
|
| ppDelete :: SqlDelete -> Doc |
|
| toInsert |
|
|
| ppInsert :: SqlInsert -> Doc |
|
| toInsertQuery |
|
|
| toCreateDB |
| :: 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.
|
|
|
| toCreateTable |
| :: TableName | name of the table to be created.
| | -> [(Attribute, FieldDesc)] | List of Attributes and FiledDescs
that describes the table.
| | -> SqlCreate | | | Use this to create a SqlCreate data type corresponding to
the SQL statement CREATE which creates a new table.
|
|
|
| ppCreate :: SqlCreate -> Doc |
| Pretty prints a SqlCreate.
|
|
| toDropDB :: String -> SqlDrop |
| Creates a SqlDrop that delete the database with the
name given as the first argument.
|
|
| toDropTable :: TableName -> SqlDrop |
| Creates a SqlDrop that delete the database named
in the first argument.
|
|
| ppDrop :: SqlDrop -> Doc |
| Pretty prints a SqlDrop.
|
|
| Produced by Haddock version 0.8 |