|
| Database.HaskellDB.Database | | Portability | non-portable | | Stability | experimental | | Maintainer | haskelldb-users@lists.sourceforge.net |
|
|
|
|
|
| Description |
| Defines standard database operations and the
primitive hooks that a particular database binding
must provide.
|
|
| Synopsis |
|
|
|
|
| Operators
|
|
| (!.) :: Select f r a => r -> f -> a |
| The (!.) operator selects over returned records from
the database (= rows)
Non-overloaded version of '!'. For backwards compatibility.
|
|
| Type declarations
|
|
| data Database |
|
|
| class GetRec er vr | er -> vr, vr -> er where |
| | Methods | | getRec | | :: GetInstances s | Driver functions for getting values
of different types.
| | -> Rel er | Phantom argument to the the return type right
| | -> Scheme | Fields to get.
| | -> s | Driver-specific result data
(for example a Statement object)
| | -> IO (Record vr) | Result record.
| | Create a result record.
|
|
| | Instances | |
|
|
| data GetInstances s |
Functions for getting values of a given type. Database drivers
need to implement these functions and pass this record to getRec
when getting query results.
All these functions should return Nothing if the value is NULL.
| | Constructors | |
|
|
| Function declarations
|
|
| query :: GetRec er vr => Database -> Query (Rel er) -> IO [Record vr] |
| performs a query on a database
|
|
| insert :: (ToPrimExprs r, ShowRecRow r, InsertRec r er) => Database -> Table er -> Record r -> IO () |
| Inserts a record into a table
|
|
| delete |
| :: ShowRecRow r | | | => Database | The database
| | -> Table r | The table to delete records from
| | -> (Rel r -> Expr Bool) | Predicate used to select records to delete
| | -> IO () | | | deletes a bunch of records
|
|
|
| update |
|
|
| insertQuery :: ShowRecRow r => Database -> Table r -> Query (Rel r) -> IO () |
| Inserts values from a query into a table
|
|
| tables |
| :: Database | Database
| | -> IO [TableName] | Names of all tables in the database
| | List all tables in the database
|
|
|
| describe |
| :: Database | Database
| | -> TableName | Name of the tables whose columns are to be listed
| | -> IO [(Attribute, FieldDesc)] | Name and type info for each column
| | List all columns in a table, along with their types
|
|
|
| transaction |
| :: Database | Database
| | -> IO a | Action to run
| | -> IO a | | | Performs some database action in a transaction. If no exception is thrown,
the changes are committed.
|
|
|
| createDB |
| :: Database | Database
| | -> String | Name of database to create
| | -> IO () | | | Is not very useful. You need to be root to use it.
We suggest you solve this in another way
|
|
|
| createTable |
|
|
| dropDB |
|
|
| dropTable |
|
|
| Produced by Haddock version 0.8 |