@@ -211,9 +211,9 @@ instance {-# OVERLAPPABLE #-} (KnownNat n, HasParameter (n-1) schema params ty)
211211-- >>> printSQL expr
212212-- ($1 :: int4)
213213param
214− :: forall n schema params relations grouping nullity ty
215− . (PGTyped schema ty, HasParameter n schema params (nullity ty))
216− => Expression schema relations grouping params (nullity ty) -- ^ param
214+ :: forall n schema params relations grouping ty
215+ . (PGTyped schema ty, HasParameter n schema params ty)
216+ => Expression schema relations grouping params ty -- ^ param
217217param = parameter @n pgtype
218218
219219instance (HasUnique relation relations columns, Has column columns ty)
@@ -1223,32 +1223,33 @@ fixarray ty = UnsafeTypeExpression $
12231223 renderTypeExpression ty <> "[" <> renderNat @n <> "]"
12241224
12251225-- | `pgtype` is a demoted version of a `PGType`
1226−class PGTyped schema (ty :: PGType) where pgtype :: TypeExpression schema (nullity ty)
1227−instance PGTyped schema 'PGbool where pgtype = bool
1228−instance PGTyped schema 'PGint2 where pgtype = int2
1229−instance PGTyped schema 'PGint4 where pgtype = int4
1230−instance PGTyped schema 'PGint8 where pgtype = int8
1231−instance PGTyped schema 'PGnumeric where pgtype = numeric
1232−instance PGTyped schema 'PGfloat4 where pgtype = float4
1233−instance PGTyped schema 'PGfloat8 where pgtype = float8
1234−instance PGTyped schema 'PGtext where pgtype = text
1226+class PGTyped schema (ty :: NullityType) where
1227+ pgtype :: TypeExpression schema ty
1228+instance PGTyped schema (nullity 'PGbool) where pgtype = bool
1229+instance PGTyped schema (nullity 'PGint2) where pgtype = int2
1230+instance PGTyped schema (nullity 'PGint4) where pgtype = int4
1231+instance PGTyped schema (nullity 'PGint8) where pgtype = int8
1232+instance PGTyped schema (nullity 'PGnumeric) where pgtype = numeric
1233+instance PGTyped schema (nullity 'PGfloat4) where pgtype = float4
1234+instance PGTyped schema (nullity 'PGfloat8) where pgtype = float8
1235+instance PGTyped schema (nullity 'PGtext) where pgtype = text
12351236instance (KnownNat n, 1 <= n)
1236− => PGTyped schema ('PGchar n) where pgtype = char @n
1237+ => PGTyped schema (nullity ('PGchar n)) where pgtype = char @n
12371238instance (KnownNat n, 1 <= n)
1238− => PGTyped schema ('PGvarchar n) where pgtype = varchar @n
1239−instance PGTyped schema 'PGbytea where pgtype = bytea
1240−instance PGTyped schema 'PGtimestamp where pgtype = timestamp
1241−instance PGTyped schema 'PGtimestamptz where pgtype = timestampWithTimeZone
1242−instance PGTyped schema 'PGdate where pgtype = date
1243−instance PGTyped schema 'PGtime where pgtype = time
1244−instance PGTyped schema 'PGtimetz where pgtype = timeWithTimeZone
1245−instance PGTyped schema 'PGinterval where pgtype = interval
1246−instance PGTyped schema 'PGuuid where pgtype = uuid
1247−instance PGTyped schema 'PGjson where pgtype = json
1248−instance PGTyped schema 'PGjsonb where pgtype = jsonb
1239+ => PGTyped schema (nullity ('PGvarchar n)) where pgtype = varchar @n
1240+instance PGTyped schema (nullity 'PGbytea) where pgtype = bytea
1241+instance PGTyped schema (nullity 'PGtimestamp) where pgtype = timestamp
1242+instance PGTyped schema (nullity 'PGtimestamptz) where pgtype = timestampWithTimeZone
1243+instance PGTyped schema (nullity 'PGdate) where pgtype = date
1244+instance PGTyped schema (nullity 'PGtime) where pgtype = time
1245+instance PGTyped schema (nullity 'PGtimetz) where pgtype = timeWithTimeZone
1246+instance PGTyped schema (nullity 'PGinterval) where pgtype = interval
1247+instance PGTyped schema (nullity 'PGuuid) where pgtype = uuid
1248+instance PGTyped schema (nullity 'PGjson) where pgtype = json
1249+instance PGTyped schema (nullity 'PGjsonb) where pgtype = jsonb
12491250instance PGTyped schema ty
1250− => PGTyped schema ('PGvararray (nullity ty)) where
1251+ => PGTyped schema (nullity ('PGvararray ty)) where
12511252 pgtype = vararray (pgtype @schema @ty)
12521253instance (KnownNat n, PGTyped schema ty)
1253− => PGTyped schema ('PGfixarray n (nullity ty)) where
1254+ => PGTyped schema (nullity ('PGfixarray n ty)) where
12541255 pgtype = fixarray @n (pgtype @schema @ty)