This is the main CDBI-module. It provides datatypes and functions to do Database-Queries working with Entities (ER-Model)
Author: Mike Tallarek, extensions by Julia Krone, Michael Hanus
Version: 0.2
insertEntry
:: a -> EntityDescription a -> Connection -> IO (Either DBError ())
Inserts an entry into the database. |
saveEntry
:: a -> EntityDescription a -> Connection -> IO (Either DBError ())
Saves an entry to the database (only for backward compatibility). |
insertEntries
:: [a] -> EntityDescription a -> Connection -> IO (Either DBError ())
Inserts several entries into the database. |
saveMultipleEntries
:: [a] -> EntityDescription a -> Connection -> IO (Either DBError ())
Saves multiple entries to the database (only for backward compatibility). |
restoreEntries
:: [a] -> EntityDescription a -> Connection -> IO (Either DBError ())
Stores entries with their current keys in the database. |
getEntries
:: Specifier -> EntityDescription a -> Criteria -> [Option] -> Maybe Int -> Connection -> IO (Either DBError [a])
Gets entries from the database. |
getColumn
:: [SetOp] -> [SingleColumnSelect a] -> [Option] -> Maybe Int -> Connection -> IO (Either DBError [a])
Gets a single Column from the database. |
getColumnTuple
:: [SetOp] -> [TupleColumnSelect a b] -> [Option] -> Maybe Int -> Connection -> IO (Either DBError [(a,b)])
Gets two Columns from the database. |
getColumnTriple
:: [SetOp] -> [TripleColumnSelect a b c] -> [Option] -> Maybe Int -> Connection -> IO (Either DBError [(a,b,c)])
Gets three Columns from the database. |
getColumnFourTuple
:: [SetOp] -> [FourColumnSelect a b c d] -> [Option] -> Maybe Int -> Connection -> IO (Either DBError [(a,b,c,d)])
Gets four Columns from the database. |
getColumnFiveTuple
:: [SetOp] -> [FiveColumnSelect a b c d e] -> [Option] -> Maybe Int -> Connection -> IO (Either DBError [(a,b,c,d,e)])
Gets five Columns from the database. |
getEntriesCombined
:: Specifier -> CombinedDescription a -> [Join] -> Criteria -> [Option] -> Maybe Int -> Connection -> IO (Either DBError [a])
Gets combined entries from the database. |
insertEntryCombined
:: a -> CombinedDescription a -> Connection -> IO (Either DBError ())
Inserts combined entries. |
saveEntryCombined
:: a -> CombinedDescription a -> Connection -> IO (Either DBError ())
Saves combined entries (for backward compatibility). |
updateEntries
:: EntityDescription a -> [ColVal] -> Constraint -> Connection -> IO (Either DBError ())
Updates entries depending on wether they fulfill the criteria or not |
updateEntry
:: a -> EntityDescription a -> Connection -> IO (Either DBError ())
Updates an entry by ID. |
updateEntryCombined
:: a -> CombinedDescription a -> Connection -> IO (Either DBError ())
Same as updateEntry but for combined Data |
deleteEntries
:: EntityDescription a -> Maybe Constraint -> Connection -> IO (Either DBError ())
Deletes entries depending on wether they fulfill the criteria or not |
Inserts an entry into the database.
|
Saves an entry to the database (only for backward compatibility). |
Inserts several entries into the database.
|
Saves multiple entries to the database (only for backward compatibility). |
Stores entries with their current keys in the database. It is an error if entries with the same key are already in the database. Thus, this operation is useful only to restore a database with saved data.
|
Gets entries from the database.
|
Gets a single Column from the database.
|
Gets two Columns from the database.
|
Gets three Columns from the database.
|
Gets four Columns from the database.
|
Gets five Columns from the database.
|
Gets combined entries from the database.
|
Inserts combined entries.
|
Saves combined entries (for backward compatibility). |
Updates entries depending on wether they fulfill the criteria or not
|
Updates an entry by ID. Works for Entities that have a primary key as first value. Function will update the entry in the database with the ID of the entry that is given as parameter with the values of the entry given as parameter
|
Same as updateEntry but for combined Data |
Deletes entries depending on wether they fulfill the criteria or not
|