使用以下持久模式,
Picture
bytes ByteString
desc Text Maybe
我想查询SELECT id, desc FROM picture WHERE desc IS NOT NULL
。但
previews :: SqlPersistT Handler [(E.Value (Key Picture), E.Value Text)]
previews = E.select $ from $ \pics -> do
where_ $ pics ?. PictureDesc E.!=. nothing
return ( pics ^. PictureId
, pics ?. PictureDesc
)
• Couldn't match type ‘Maybe (Entity Picture)’
with ‘Entity Picture’
Expected type: SqlExpr (Entity Picture)
Actual type: SqlExpr (Maybe (Entity Picture))
• In the first argument of ‘(^.)’, namely ‘pics’
我如何实现previews
'签名?