imm-1.8.0.0: Execute arbitrary callbacks for each element of RSS/Atom feeds

Safe HaskellNone
LanguageHaskell2010

Imm.Database

Contents

Description

Database module abstracts over a key-value database that supports CRUD operations.

This module follows the Handle pattern.

import qualified Imm.Database as Database
Synopsis

Types

class (Ord (Key t), Show (Key t), Show (Entry t), Typeable t, Show t, Pretty t, Pretty (Key t)) => Table t where Source #

Generic database table

Associated Types

type Key t :: * Source #

type Entry t :: * Source #

Methods

rep :: t Source #

Instances
Table FeedTable Source # 
Instance details

Defined in Imm.Database.FeedTable

Associated Types

type Key FeedTable :: Type Source #

type Entry FeedTable :: Type Source #

Methods

rep :: FeedTable Source #

data Handle m t Source #

Constructors

Handle 

Fields

readOnly :: Monad m => Pretty (Key t) => Handle m -> Handle m t -> Handle m t Source #

data DatabaseException t Source #

Constructors

NotCommitted t 
NotDeleted t [Key t] 
NotFound t [Key t] 
NotInserted t [(Key t, Entry t)] 
NotPurged t 
NotUpdated t (Key t) 
UnableFetchAll t 
Instances
(Eq t, Eq (Key t), Eq (Entry t)) => Eq (DatabaseException t) Source # 
Instance details

Defined in Imm.Database

(Show t, Show (Key t), Show (Entry t)) => Show (DatabaseException t) Source # 
Instance details

Defined in Imm.Database

(Table t, Show (Key t), Show (Entry t), Pretty (Key t), Typeable t) => Exception (DatabaseException t) Source # 
Instance details

Defined in Imm.Database

(Pretty t, Pretty (Key t)) => Pretty (DatabaseException t) Source # 
Instance details

Defined in Imm.Database

Methods

pretty :: DatabaseException t -> Doc ann #

prettyList :: [DatabaseException t] -> Doc ann #

Primitives

fetch :: Monad m => Table t => MonadThrow m => Handle m t -> Key t -> m (Entry t) Source #

fetchList :: Monad m => Handle m t -> [Key t] -> m (Map (Key t) (Entry t)) Source #

fetchAll :: Monad m => Handle m t -> m (Map (Key t) (Entry t)) Source #

update :: Monad m => Handle m t -> Key t -> (Entry t -> Entry t) -> m () Source #

insert :: Monad m => Handle m -> Handle m t -> Key t -> Entry t -> m () Source #

insertList :: Monad m => Handle m -> Handle m t -> [(Key t, Entry t)] -> m () Source #

delete :: Monad m => Handle m -> Handle m t -> Key t -> m () Source #

deleteList :: Monad m => Handle m -> Handle m t -> [Key t] -> m () Source #

purge :: Monad m => Handle m -> Handle m t -> m () Source #

commit :: Monad m => Handle m -> Handle m t -> m () Source #

table :: Table t => Handle m t -> t Source #