mealstrom-0.0.0.1: Manipulate FSMs and store them in PostgreSQL.

Copyright(c) Max Amanshauser 2016
LicenseMIT
Maintainermax@lambdalifting.org
Safe HaskellNone
LanguageHaskell2010

Mealstrom.PostgresJSONStore

Contents

Description

This module is the main backend for FSMs. Instances are stored in a table with the name passed as storeName when creating the PostgresJSONStore. WALs use the same name with Wal appended.

Synopsis

Documentation

mkStore :: String -> Text -> IO PostgresJSONStore Source #

Creates a postgresql store

_fsmRead :: (FromJSON s, FromJSON e, FromJSON a, Typeable s, Typeable e, Typeable a, MealyInstance k s e a) => PostgresJSONStore -> k -> Proxy k s e a -> IO (Maybe (Instance k s e a)) Source #

_fsmCreate :: forall k s e a. (ToJSON s, ToJSON e, ToJSON a, Typeable s, Typeable e, Typeable a, MealyInstance k s e a) => PostgresJSONStore -> Instance k s e a -> IO (Maybe String) Source #

Orphan instances

FSMKey k => ToField k Source # 

Methods

toField :: k -> Action #

FSMKey k => FromField k Source # 

Methods

fromField :: FieldParser k #

FSMKey k => Generic (WALEntry k) Source # 

Associated Types

type Rep (WALEntry k) :: * -> * #

Methods

from :: WALEntry k -> Rep (WALEntry k) x #

to :: Rep (WALEntry k) x -> WALEntry k #

ToJSON e => ToJSON (Msg e) Source # 

Methods

toJSON :: Msg e -> Value #

toEncoding :: Msg e -> Encoding #

toJSONList :: [Msg e] -> Value #

toEncodingList :: [Msg e] -> Encoding #

FromJSON e => FromJSON (Msg e) Source # 

Methods

parseJSON :: Value -> Parser (Msg e) #

parseJSONList :: Value -> Parser [Msg e] #

FSMKey k => FromRow (WALEntry k) Source # 

Methods

fromRow :: RowParser (WALEntry k) #

(ToJSON s, ToJSON e, ToJSON a) => ToJSON (Machine s e a) Source #

Instance to convert one DB row to an instance of Instance ;) users of this module must provide instances for ToJSON, FromJSON for s, e and a.

Methods

toJSON :: Machine s e a -> Value #

toEncoding :: Machine s e a -> Encoding #

toJSONList :: [Machine s e a] -> Value #

toEncodingList :: [Machine s e a] -> Encoding #

(FromJSON s, FromJSON e, FromJSON a) => FromJSON (Machine s e a) Source # 

Methods

parseJSON :: Value -> Parser (Machine s e a) #

parseJSONList :: Value -> Parser [Machine s e a] #

(Typeable * s, Typeable * e, Typeable * a, ToJSON s, ToJSON e, ToJSON a) => ToField (Machine s e a) Source # 

Methods

toField :: Machine s e a -> Action #

(Typeable * s, Typeable * e, Typeable * a, FromJSON s, FromJSON e, FromJSON a) => FromField (Machine s e a) Source # 

Methods

fromField :: FieldParser (Machine s e a) #

(Typeable * s, Typeable * e, Typeable * a, FromJSON s, FromJSON e, FromJSON a, FSMKey k) => FromRow (Instance k s e a) Source # 

Methods

fromRow :: RowParser (Instance k s e a) #