@@ -100,6 +100,7 @@ module Squeal.PostgreSQL.Expression
100100 , max_, maxDistinct, min_, minDistinct
101101 -- * Tables
102102 , Table (UnsafeTable, renderTable)
103+ -- * Types
103104 , TypeExpression (UnsafeTypeExpression, renderTypeExpression)
104105 , PGTyped (pgtype)
105106 , bool
@@ -349,12 +350,12 @@ nullIf x y = UnsafeExpression $ "NULL IF" <+> parenthesized
349350array
350351 :: [Expression tables grouping params ('Null ty)]
351352 -- ^ array elements
352− -> Expression tables grouping params (nullity ('PGarray ty))
353+ -> Expression tables grouping params (nullity ('PGvararray ty))
353354array xs = UnsafeExpression $
354355 "ARRAY[" <> commaSeparated (renderExpression <$> xs) <> "]"
355356
356357instance Monoid
357− (Expression tables grouping params (nullity ('PGarray ty))) where
358+ (Expression tables grouping params (nullity ('PGvararray ty))) where
358359 mempty = array []
359360 mappend = unsafeBinaryOp "||"
360361
@@ -1165,14 +1166,14 @@ jsonb = UnsafeTypeExpression "jsonb"
11651166-- | variable length array
11661167vararray
11671168 :: TypeExpression ('NoDef :=> 'Null pg)
1168− -> TypeExpression ('NoDef :=> 'Null ('PGarray pg))
1169+ -> TypeExpression ('NoDef :=> 'Null ('PGvararray pg))
11691170vararray ty = UnsafeTypeExpression $ renderTypeExpression ty <> "[]"
11701171-- | fixed length array
11711172fixarray
11721173 :: KnownNat n
11731174 => proxy n
11741175 -> TypeExpression ('NoDef :=> 'Null pg)
1175− -> TypeExpression ('NoDef :=> 'Null ('PGarrayN n pg))
1176+ -> TypeExpression ('NoDef :=> 'Null ('PGfixarray n pg))
11761177fixarray p ty = UnsafeTypeExpression $
11771178 renderTypeExpression ty <> "[" <> renderNat p <> "]"
11781179
@@ -1216,7 +1217,7 @@ instance PGTyped 'PGinterval where pgtype = interval
12161217instance PGTyped 'PGuuid where pgtype = uuid
12171218instance PGTyped 'PGjson where pgtype = json
12181219instance PGTyped 'PGjsonb where pgtype = jsonb
1219−instance PGTyped ty => PGTyped ('PGarray ty) where
1220+instance PGTyped ty => PGTyped ('PGvararray ty) where
12201221 pgtype = vararray (pgtype @ty)
1221−instance (KnownNat n, PGTyped ty) => PGTyped ('PGarrayN n ty) where
1222+instance (KnownNat n, PGTyped ty) => PGTyped ('PGfixarray n ty) where
12221223 pgtype = fixarray (Proxy @n) (pgtype @ty)