getPostList :: (MonadReader Config m, MonadIO m) => m [PostField]
getPostList = do
  config <- ask
  let conn = _configConnection config
  liftIO $ query conn
  where
    query :: Simple.Connection -> IO [PostField]
    query c = Simple.query_ c "SELECT * FROM Post ORDER BY created_at DESC"

-- =============================================================================
-- Server
-- =============================================================================
getPostList :: (MonadReader Config m, MonadIO m) => m [PostField]
getPostList = do
  config <- ask
  let conn = _configConnection config
  liftIO $ query conn
  where
    query :: Simple.Connection -> IO [PostField]
    query c = Simple.query_ c "SELECT * FROM Post ORDER BY created_at DESC"

-- =============================================================================
-- Server
-- =============================================================================
getPostList = do
  config <- ask
  let conn = _configConnection config
  liftIO $ query conn
  where
    query :: Simple.Connection -> IO [PostField]
    query c = Simple.query_ c "SELECT * FROM Post ORDER BY created_at DESC"

-- =============================================================================
-- Server
-- =============================================================================