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