Copyright | (c) Amy de Buitléir 2012-2016 |
---|---|
License | BSD-style |
Maintainer | amy@nualeargais.ie |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell98 |
Database interface for the Créatúr framework.
- class Database d where
- type DBRecord d
- class Record r where
- class Record r => SizedRecord r where
Documentation
class Database d where Source #
A database offering storage and retrieval for records.
keys :: StateT d IO [String] Source #
Get a list of all active keys in the database.
numRecords :: StateT d IO Int Source #
Return the number of records stored in the database.
archivedKeys :: StateT d IO [String] Source #
Get a list of all archived keys in the database. If the database does not implement archiving, it may return an empty list.
lookup :: Serialize (DBRecord d) => String -> StateT d IO (Either String (DBRecord d)) Source #
Read an active record from the database.
lookupInArchive :: Serialize (DBRecord d) => String -> StateT d IO (Either String (DBRecord d)) Source #
Read an archived record from the database.
store :: (Record (DBRecord d), Serialize (DBRecord d)) => DBRecord d -> StateT d IO () Source #
Write a record to the database. If an agent with the same name already exists, it will be overwritten.
delete :: Serialize (DBRecord d) => String -> StateT d IO () Source #
Remove a record from the database. The database may archive records rather than simply deleting them.
Database (FSDatabase r) Source # | |
SizedRecord r => Database (CachedFSDatabase r) Source # | |