-
|
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 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 (this should be with 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? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
You need https://hackage.haskell.org/package/rel8-1.6.0.0/docs/Rel8.html#v:nullsFirst (or |
Beta Was this translation helpful? Give feedback.
-
compiles, so that must be right .... |
Beta Was this translation helpful? Give feedback.
You need https://hackage.haskell.org/package/rel8-1.6.0.0/docs/Rel8.html#v:nullsFirst (or
nullsLast). Is that what you're looking for?