For a query simple as that
runDb . select . from $ \cell -> do
where_ $ cell ^. CellCode ==. val "x"
return cell
I want to apply a function before the comparison of the field value with "x". The reason is that the cell code has trailing spaces in the database and nothing easier than trimming them away, e.g. with strip from Data.Text
. However, my initial approach of using fmap
(twice) resulted in
No Instance for (Functor SqlExpr)
I know that there are functions provides by Esqueleto, like just
, that accomplish similar things specifically (I couldn't find the implementation of just
, though).
Is there a way to apply any function on the packed value?
While writing: in my specific case, I just might want to use like
.
EDIT: Added the specific function I want to apply.