Skip to content

Commit

Permalink
IsSqlType instance is needed if the field is an array of enum
Browse files Browse the repository at this point in the history
when toFields is used on sql array, it uses this instance

```
(Default ToFields a (Field_ n b), IsSqlType b) => Default ToFields [a] (Field (SqlArray_ n b))
```

Which cast the value to the enum type
  • Loading branch information
stevemao authored and tomjaguarpaw committed Apr 8, 2024
1 parent f636249 commit f0718ce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Opaleye/Experimental/Enum.hs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ data EnumMapper sqlEnum haskellSum = EnumMapper {
--
-- instance D.Default O.ToFields Rating (O.Field SqlRating) where
-- def = enumToFields sqlRatingMapper
--
-- instance IsSqlType SqlRating where
-- showSqlType _ = "mpaa_rating"
-- @
enumMapper :: String
-- ^ The name of the @ENUM@ type
Expand Down

0 comments on commit f0718ce

Please sign in to comment.