-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Description
With (my actual data is a little more complicated than this, and the column isn't an integer, but is a also an instance of DBOrd)
data NotInteresting f = NotInteresting { ni :: Column f (Maybe Int64) }
deriving stock (Generic)
deriving anyclass (Rel8able)
notInterestingSchema :: TableSchema (NotInteresting Name)
notInterestingSchema = TableSchema {
name = "ni"
, columns = NotInteresting { ni = "nini" }
}
getNI = orderBy (ni >$< desc) $ do
row <- each notInterestingSchema
pure rowI get
• No instance for ‘DBOrd (Maybe Int64)’
arising from a use of ‘desc’
• In the second argument of ‘(>$<)’, namely ‘desc’
In the first argument of ‘orderBy’, namely ‘(ni >$< desc)’
In the first argument of ‘($)’, namely ‘orderBy (ni >$< desc)’
(this should be with rel8 1.6.0.0).
Is there a way to add an instance for something like
instance DBOrd a => DBOrd (Maybe a)although this probably interacts with #310 and the choice of how to handle nulls, or some other way to write a query that lets be order on a maybe column?
Metadata
Metadata
Assignees
Labels
No labels