@@ -60,7 +60,7 @@ import Network.IP.Addr
60import Text.Read (readMaybe)
60import Text.Read (readMaybe)
62import qualified Data.ByteString.Lazy as Lazy
62import qualified Data.ByteString.Lazy as Lazy
63−import qualified Data.ByteString as Strict hiding (unpack)
63+import qualified Data.ByteString as Strict hiding (pack, unpack)
64import qualified Data.Text.Lazy as Lazy
64import qualified Data.Text.Lazy as Lazy
65import qualified Data.Text as Strict
65import qualified Data.Text as Strict
66import qualified Data.Vector as Vector
66import qualified Data.Vector as Vector
@@ -123,7 +123,16 @@ instance (HasOid pg, ToParam x pg)
123 => ToParam (Vector (Maybe x)) ('PGvararray pg) where
123 => ToParam (Vector (Maybe x)) ('PGvararray pg) where
124 toParam = K . Encoding.nullableArray_vector
124 toParam = K . Encoding.nullableArray_vector
125 (oid @pg) (unK . toParam @x @pg)
125 (oid @pg) (unK . toParam @x @pg)
129+ -- , SameLabels (DatatypeInfoOf y) labels
131+ -- uncomment above constraint when GHC issue #11671 is fixed
132+ -- Allow labels starting with uppercase with OverloadedLabels
133+ -- https://ghc.haskell.org/trac/ghc/ticket/11671?cversion=0&cnum_hist=8
134+ ) => ToParam x ('PGenum labels) where
135+ toParam = K . Encoding.text_strict . Strict.pack . show
127-- | A `ToColumnParam` constraint lifts the `ToParam` encoding
136-- | A `ToColumnParam` constraint lifts the `ToParam` encoding
128-- of a `Type` to a `ColumnType`, encoding `Maybe`s to `Null`s. You should
137-- of a `Type` to a `ColumnType`, encoding `Maybe`s to `Null`s. You should
129-- not define instances of `ToColumnParam`, just use the provided instances.
138-- not define instances of `ToColumnParam`, just use the provided instances.