tomjaguarpaw / haskell-opaleye

Other
602 stars 115 forks source link

IsSqlType instance is needed if the field is an array of enum #588

Closed stevemao closed 5 months ago

stevemao commented 5 months ago

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

tomjaguarpaw commented 5 months ago

Thanks! At some point I'll fold this into EnumMapper.

tomjaguarpaw commented 5 months ago

I incorporated this into EnumMapper in https://github.com/tomjaguarpaw/haskell-opaleye/commit/91727ec6af166e6a5c9bdfa8cced4f41bcf9dc93