2015-07-28 06:18:58 +00:00
|
|
|
{-# LANGUAGE OverloadedStrings #-}
|
|
|
|
module Within.DBMemorial.Post where
|
|
|
|
|
2015-07-28 07:00:18 +00:00
|
|
|
import Control.Applicative
|
|
|
|
import Data.Monoid ()
|
|
|
|
import Data.Text
|
|
|
|
import Database.SQLite.Simple.FromRow
|
2015-07-28 06:18:58 +00:00
|
|
|
|
2015-07-28 06:47:39 +00:00
|
|
|
data Post = Post
|
2015-07-28 06:53:11 +00:00
|
|
|
{ id :: Int
|
|
|
|
, oID :: Text
|
|
|
|
, body :: Text
|
|
|
|
, markdown :: Text
|
|
|
|
, author :: Text
|
|
|
|
, page :: Int
|
2015-07-28 06:47:39 +00:00
|
|
|
} deriving (Show, Eq)
|
2015-07-28 06:18:58 +00:00
|
|
|
|
|
|
|
instance FromRow Post where
|
|
|
|
fromRow = Post <$> field <*> field <*> field <*> field <*> field <*> field
|