@@ -66,19 +66,19 @@ instance ToParam Value 'PGJson where toParam = K . Encoding.json_ast
6666instance ToParam Value 'PGJsonb where toParam = K . Encoding.jsonb_ast
6767
6868class ToColumnParam x (ty :: ColumnType) where
69− toColumnParam :: x -> K (Maybe Encoding.Encoding) ty
69+ toColumnParam :: x -> K (Maybe Strict.ByteString) ty
7070instance ToParam x pg => ToColumnParam x ('Required ('NotNull pg)) where
71− toColumnParam = K . Just . unK . toParam @x @pg
71+ toColumnParam = K . Just . Encoding.encodingBytes . unK . toParam @x @pg
7272instance ToParam x pg => ToColumnParam (Maybe x) ('Required ('Null pg)) where
73− toColumnParam = K . fmap (unK . toParam @x @pg)
73+ toColumnParam = K . fmap (Encoding.encodingBytes . unK . toParam @x @pg)
7474instance ToParam x pg => ToColumnParam (Maybe x) ('Optional (nullity pg)) where
75− toColumnParam = K . fmap (unK . toParam @x @pg)
75+ toColumnParam = K . fmap (Encoding.encodingBytes . unK . toParam @x @pg)
7676
7777class ToParams x (tys :: [ColumnType]) where
78− toParams :: x -> NP (K (Maybe Encoding.Encoding)) tys
78+ toParams :: x -> NP (K (Maybe Strict.ByteString)) tys
7979 default toParams
8080 :: (IsProductType x xs, AllZip ToColumnParam xs tys)
81− => x -> NP (K (Maybe Encoding.Encoding)) tys
81+ => x -> NP (K (Maybe Strict.ByteString)) tys
8282 toParams
8383 = htrans (Proxy @ToColumnParam) (toColumnParam . unI)
8484 . unZ . unSOP . from
@@ -123,7 +123,7 @@ instance FromValue pg y
123123 => FromColumnValue (column ::: ('Required ('NotNull pg))) y where
124124 fromColumnValue = \case
125125 K Nothing -> error "fromColumnValue: saw NULL when expecting NOT NULL"
126− (K (Just bytes)) ->
126+ K (Just bytes) ->
127127 let
128128 errOrValue =
129129 Decoding.valueParser (fromValue @pg @y Proxy) bytes
@@ -146,4 +146,4 @@ class FromRow (columns :: [(Symbol,ColumnType)]) y where
146146 => NP (K (Maybe Strict.ByteString)) columns -> y
147147 fromRow
148148 = to . SOP . Z
149− . htrans (Proxy :: Proxy FromColumnValue) (I . fromColumnValue)
149+ . htrans (Proxy @FromColumnValue) (I . fromColumnValue)