|
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? |
Answered by
ocharles
Jan 14, 2025
Replies: 2 comments 1 reply
|
You need https://hackage.haskell.org/package/rel8-1.6.0.0/docs/Rel8.html#v:nullsFirst (or |
1 reply
Answer selected by
DougBurke
compiles, so that must be right .... |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?