Safe Haskell | None |
---|---|
Language | Haskell2010 |
Model : Yu.Core.Model.Internal Description : The basic methods for model and types Copyright : (C) 2017-2018 Johann Lee me@qinka.pro License : GPL3 Maintainer : me@qinka.pro Stability : experimental Portability : unknown
The basic method and type for model in MVC
- data Nav = Nav {}
- navToDoc :: Nav -> Document
- docToNav :: Document -> Maybe Nav
- data ResT = ResT {}
- resToDoc :: ResT -> Document
- docToRes :: Document -> Maybe ResT
- fromBinary :: Binary -> ByteString
- class (MonadIO m, MonadBaseControl IO m) => Mongodic a m | m -> a where
- type ConnectionPool = Pool Pipe
- fetchContext :: (MonadIO m, Val a) => Text -> ResT -> Text -> Action m (Maybe a)
- fetchRes :: MonadIO m => [Text] -> Action m (Maybe ResT)
- fetchResAll :: (MonadIO m, MonadBaseControl IO m) => Action m [ResT]
- updateContext :: (MonadIO m, Val a) => Text -> Maybe ObjectId -> Text -> a -> Action m ObjectId
- updateItem :: (MonadIO m, Val a) => Text -> Text -> a -> ResT -> Action m ()
- updateRes :: MonadIO m => ResT -> Action m ()
- deleteContext :: MonadIO m => ResT -> Text -> Action m ()
- deleteItem :: MonadIO m => [Text] -> Text -> Action m ()
- deleteRes :: MonadIO m => ResT -> Action m ()
- deleteContextMaybe :: MonadIO m => Maybe ResT -> Action m ()
- (=@) :: Val v => Label -> Maybe v -> Maybe Field
- module Database.MongoDB
- module Data.Pool
navigation bar
the resource
the resource type for item
ResT | |
|
transform
fromBinary :: Binary -> ByteString Source #
Binary to ByteString
about mongoDB
class (MonadIO m, MonadBaseControl IO m) => Mongodic a m | m -> a where Source #
the type-class which means mongoDB available.
:: m AccessMode | get the accedd mode |
:: m Database | get the default database |
:: m ConnectionPool | get the connection pool |
type ConnectionPool = Pool Pipe Source #
ConnectionPool
:: (MonadIO m, Val a) | |
=> Text | field name |
-> ResT | resource index |
-> Text | collection |
-> Action m (Maybe a) | result |
fetch context
fetchResAll :: (MonadIO m, MonadBaseControl IO m) => Action m [ResT] Source #
fetch all resource index
:: (MonadIO m, Val a) | |
=> Text | collection |
-> Maybe ObjectId | obj id of item |
-> Text | field name |
-> a | |
-> Action m ObjectId | return id |
update context
:: (MonadIO m, Val a) | |
=> Text | type, or say collection |
-> Text | field name |
-> a | item |
-> ResT | ` |
-> Action m () |
the update for item
delete the resouce in maybe
module Database.MongoDB
module Data.Pool