Skip to content

Commit

Permalink
Added instance DefaultFromField (T.SqlArray_ Nullable a) [Maybe b]
Browse files Browse the repository at this point in the history
This should have been added when we did the Column -> Field conversion

Addresses #558 (comment)
  • Loading branch information
tomjaguarpaw committed Sep 1, 2022
1 parent c52705b commit 89e183e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Added `instance DefaultFromField (T.SqlArray_ Nullable a) [Maybe b]`

* Changed `ascNullsFirst` and `descNullsLast` to work with nullable
fields. This rectifies an oversight from the `Column` to `Field`
change. This may technically be a PVP violation but I think the
Expand Down
4 changes: 4 additions & 0 deletions src/Opaleye/Internal/RunQuery.hs
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ instance (Typeable b, DefaultFromField a b) =>
DefaultFromField (T.SqlRange a) (PGSR.PGRange b) where
defaultFromField = fromFieldRange defaultFromField

instance (Typeable b, DefaultFromField a b) =>
DefaultFromField (T.SqlArray_ Nullable a) [Maybe b] where
defaultFromField = fromFieldArrayNullable defaultFromField

fromFieldRange :: Typeable b
=> FromField a b
-> FromField (T.SqlRange a) (PGSR.PGRange b)
Expand Down

0 comments on commit 89e183e

Please sign in to comment.