@@ -274,11 +274,9 @@ class ToParam (x :: Type) (pg :: PGType) where
274274 toParam :: x -> K Encoding.Encoding pg
275275instance ToParam Bool 'PGbool where toParam = K . Encoding.bool
276276instance ToParam Int16 'PGint2 where toParam = K . Encoding.int2_int16
277−instance ToParam Word16 'PGint2 where toParam = K . Encoding.int2_word16
278277instance ToParam Int32 'PGint4 where toParam = K . Encoding.int4_int32
279−instance ToParam Word32 'PGint4 where toParam = K . Encoding.int4_word32
280278instance ToParam Int64 'PGint8 where toParam = K . Encoding.int8_int64
281−instance ToParam Word64 'PGint8 where toParam = K . Encoding.int8_word64
279+instance ToParam Word32 'PGoid where toParam = K . Encoding.int4_word32
282280instance ToParam Float 'PGfloat4 where toParam = K . Encoding.float4
283281instance ToParam Double 'PGfloat8 where toParam = K . Encoding.float8
284282instance ToParam Scientific 'PGnumeric where toParam = K . Encoding.numeric
@@ -314,21 +312,21 @@ instance Aeson.ToJSON x => ToParam (Jsonb x) 'PGjsonb where
314312instance (ToNullityParam x ty, ty ~ nullity pg, HasOid pg)
315313 => ToParam (VarArray [x]) ('PGvararray ty) where
316314 toParam = K
317− . Encoding.array_foldable (oid @pg) (unK . toNullityParam @x @ty)
315+ . Encoding.array_foldable (oidOf @pg) (unK . toNullityParam @x @ty)
318316 . getVarArray
319317instance (ToParam x pg, HasOid pg)
320318 => ToParam (VarArray (Vector x)) ('PGvararray ('NotNull pg)) where
321319 toParam = K
322− . Encoding.array_vector (oid @pg) (unK . toParam @x @pg)
320+ . Encoding.array_vector (oidOf @pg) (unK . toParam @x @pg)
323321 . getVarArray
324322instance (ToParam x pg, HasOid pg)
325323 => ToParam (VarArray (Vector (Maybe x))) ('PGvararray ('Null pg)) where
326324 toParam = K
327− . Encoding.nullableArray_vector (oid @pg) (unK . toParam @x @pg)
325+ . Encoding.nullableArray_vector (oidOf @pg) (unK . toParam @x @pg)
328326 . getVarArray
329327instance (ToFixArray x dims ty, ty ~ nullity pg, HasOid pg)
330328 => ToParam (FixArray x) ('PGfixarray dims ty) where
331− toParam = K . Encoding.array (oid @pg)
329+ toParam = K . Encoding.array (oidOf @pg)
332330 . unK . unK . toFixArray @x @dims @ty . getFixArray
333331instance
334332 ( IsEnumType x
@@ -397,36 +395,36 @@ instance
397395-- | The object identifier of a `PGType`.
398396--
399397-- >>> :set -XTypeApplications
400−-- >>> oid @'PGbool
398+-- >>> oidOf @'PGbool
401399-- 16
402−class HasOid (ty :: PGType) where oid :: Word32
403−instance HasOid 'PGbool where oid = 16
404−instance HasOid 'PGint2 where oid = 21
405−instance HasOid 'PGint4 where oid = 23
406−instance HasOid 'PGint8 where oid = 20
407−instance HasOid 'PGnumeric where oid = 1700
408−instance HasOid 'PGfloat4 where oid = 700
409−instance HasOid 'PGfloat8 where oid = 701
410−instance HasOid ('PGchar n) where oid = 18
411−instance HasOid ('PGvarchar n) where oid = 1043
412−instance HasOid 'PGtext where oid = 25
413−instance HasOid 'PGbytea where oid = 17
414−instance HasOid 'PGtimestamp where oid = 1114
415−instance HasOid 'PGtimestamptz where oid = 1184
416−instance HasOid 'PGdate where oid = 1082
417−instance HasOid 'PGtime where oid = 1083
418−instance HasOid 'PGtimetz where oid = 1266
419−instance HasOid 'PGinterval where oid = 1186
420−instance HasOid 'PGuuid where oid = 2950
421−instance HasOid 'PGinet where oid = 869
422−instance HasOid 'PGjson where oid = 114
423−instance HasOid 'PGjsonb where oid = 3802
400+class HasOid (ty :: PGType) where oidOf :: Word32
401+instance HasOid 'PGbool where oidOf = 16
402+instance HasOid 'PGint2 where oidOf = 21
403+instance HasOid 'PGint4 where oidOf = 23
404+instance HasOid 'PGint8 where oidOf = 20
405+instance HasOid 'PGnumeric where oidOf = 1700
406+instance HasOid 'PGfloat4 where oidOf = 700
407+instance HasOid 'PGfloat8 where oidOf = 701
408+instance HasOid ('PGchar n) where oidOf = 18
409+instance HasOid ('PGvarchar n) where oidOf = 1043
410+instance HasOid 'PGtext where oidOf = 25
411+instance HasOid 'PGbytea where oidOf = 17
412+instance HasOid 'PGtimestamp where oidOf = 1114
413+instance HasOid 'PGtimestamptz where oidOf = 1184
414+instance HasOid 'PGdate where oidOf = 1082
415+instance HasOid 'PGtime where oidOf = 1083
416+instance HasOid 'PGtimetz where oidOf = 1266
417+instance HasOid 'PGinterval where oidOf = 1186
418+instance HasOid 'PGuuid where oidOf = 2950
419+instance HasOid 'PGinet where oidOf = 869
420+instance HasOid 'PGjson where oidOf = 114
421+instance HasOid 'PGjsonb where oidOf = 3802
424422
425423-- | Lifts a `HasOid` constraint to a field.
426424class HasAliasedOid (field :: (Symbol, NullityType)) where
427425 aliasedOid :: Word32
428426instance HasOid ty => HasAliasedOid (alias ::: nullity ty) where
429− aliasedOid = oid @ty
427+ aliasedOid = oidOf @ty
430428
431429-- | A `ToNullityParam` constraint gives an encoding of a Haskell `Type` into
432430-- into the binary format of a PostgreSQL `NullityType`.
@@ -495,6 +493,7 @@ instance FromValue 'PGbool Bool where fromValue = Decoding.bool
495493instance FromValue 'PGint2 Int16 where fromValue = Decoding.int
496494instance FromValue 'PGint4 Int32 where fromValue = Decoding.int
497495instance FromValue 'PGint8 Int64 where fromValue = Decoding.int
496+instance FromValue 'PGoid Word32 where fromValue = Decoding.int
498497instance FromValue 'PGfloat4 Float where fromValue = Decoding.float4
499498instance FromValue 'PGfloat8 Double where fromValue = Decoding.float8
500499instance FromValue 'PGnumeric Scientific where fromValue = Decoding.numeric