Converting a MaybeTable Expr (Expr a)
into a Expr (Maybe a)
#360
-
My initial objective was to convert the result of an I am building a query that checks multiple sources for the same data, and I'm trying to return a record-of- data LookupResult f = LookupResult
{ fromSource1 :: Column f (Maybe Int)
, fromSource2 :: Column f (Maybe Int)
} deriving stock (Generic)
deriving anyclass (Rel8able) Both tables I'm querying have the same primary key, but the tables are slightly different:
This query against I can work around this by assembling the record outside of the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi @JackKelly-Bellroy! Try: maybeTable null nullify yourMaybeTableValue If I understood you correctly! If not, can you provide more code along with the error? |
Beta Was this translation helpful? Give feedback.
-
Sorry for being a bit vague, I'm trying to show only the relevant details from some internal code. Both (id $?) Is this safe in general, and if so, should it be made more prominent? Some ideas:
I can PR this, once we decide what makes sense here. |
Beta Was this translation helpful? Give feedback.
Hi @JackKelly-Bellroy! Try:
maybeTable null nullify yourMaybeTableValue
If I understood you correctly! If not, can you provide more code along with the error?