on dev help sign in
remove proxy argument from `oid`
commit576bd390ab2f4a958c2f3e190fb44533808f05c7 authorEitan Chatav <eitan.chatav@gmail.com> dateThu 1 Mar 2018, 10:29 (9 years ago) parent95d3cb3
2 files changed+26−26
squeal-postgresql/src/Squeal/PostgreSQL/Binary.hs+1−1 squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+25−25
squeal-postgresql/src/Squeal/PostgreSQL/Binary.hs+1−1
@@ -118,7 +118,7 @@ instance ToParam Value 'PGjsonb where toParam = K . Encoding.jsonb_ast
118118instance (HasOid pg, ToParam x pg)
119119 => ToParam (Vector (Maybe x)) ('PGarray pg) where
120120 toParam = K . Encoding.nullableArray_vector
121− (oid (Proxy @pg)) (unK . toParam @x @pg)
121+ (oid @pg) (unK . toParam @x @pg)
122122
123123-- | A `ToColumnParam` constraint lifts the `ToParam` encoding
124124-- of a `Type` to a `ColumnType`, encoding `Maybe`s to `Null`s. You should
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+25−25
@@ -9,7 +9,8 @@ A type-level DSL for kinds of PostgreSQL types, constraints, and aliases.
99-}
1010
1111{-# LANGUAGE
12− ConstraintKinds
12+ AllowAmbiguousTypes
13+ , ConstraintKinds
1314 , DataKinds
1415 , DeriveAnyClass
1516 , DeriveDataTypeable
@@ -133,31 +134,30 @@ data PGType
133134-- | The object identifier of a `PGType`.
134135--
135136-- >>> :set -XTypeApplications
136−-- >>> import Data.Proxy
137−-- >>> oid (Proxy @'PGbool)
137+-- >>> oid @'PGbool
138138-- 16
139−class HasOid (ty :: PGType) where oid :: proxy ty -> Word32
140−instance HasOid 'PGbool where oid _ = 16
141−instance HasOid 'PGint2 where oid _ = 21
142−instance HasOid 'PGint4 where oid _ = 23
143−instance HasOid 'PGint8 where oid _ = 20
144−instance HasOid 'PGnumeric where oid _ = 1700
145−instance HasOid 'PGfloat4 where oid _ = 700
146−instance HasOid 'PGfloat8 where oid _ = 701
147−instance HasOid ('PGchar n) where oid _ = 18
148−instance HasOid ('PGvarchar n) where oid _ = 1043
149−instance HasOid 'PGtext where oid _ = 25
150−instance HasOid 'PGbytea where oid _ = 17
151−instance HasOid 'PGtimestamp where oid _ = 1114
152−instance HasOid 'PGtimestamptz where oid _ = 1184
153−instance HasOid 'PGdate where oid _ = 1082
154−instance HasOid 'PGtime where oid _ = 1083
155−instance HasOid 'PGtimetz where oid _ = 1266
156−instance HasOid 'PGinterval where oid _ = 1186
157−instance HasOid 'PGuuid where oid _ = 2950
158−instance HasOid 'PGinet where oid _ = 869
159−instance HasOid 'PGjson where oid _ = 114
160−instance HasOid 'PGjsonb where oid _ = 3802
139+class HasOid (ty :: PGType) where oid :: Word32
140+instance HasOid 'PGbool where oid = 16
141+instance HasOid 'PGint2 where oid = 21
142+instance HasOid 'PGint4 where oid = 23
143+instance HasOid 'PGint8 where oid = 20
144+instance HasOid 'PGnumeric where oid = 1700
145+instance HasOid 'PGfloat4 where oid = 700
146+instance HasOid 'PGfloat8 where oid = 701
147+instance HasOid ('PGchar n) where oid = 18
148+instance HasOid ('PGvarchar n) where oid = 1043
149+instance HasOid 'PGtext where oid = 25
150+instance HasOid 'PGbytea where oid = 17
151+instance HasOid 'PGtimestamp where oid = 1114
152+instance HasOid 'PGtimestamptz where oid = 1184
153+instance HasOid 'PGdate where oid = 1082
154+instance HasOid 'PGtime where oid = 1083
155+instance HasOid 'PGtimetz where oid = 1266
156+instance HasOid 'PGinterval where oid = 1186
157+instance HasOid 'PGuuid where oid = 2950
158+instance HasOid 'PGinet where oid = 869
159+instance HasOid 'PGjson where oid = 114
160+instance HasOid 'PGjsonb where oid = 3802
161161
162162-- | `NullityType` encodes the potential presence or definite absence of a
163163-- @NULL@ allowing operations which are sensitive to such to be well typed.