@@ -100,6 +100,7 @@ module Squeal.PostgreSQL.Expression
100 , max_, maxDistinct, min_, minDistinct
100 , max_, maxDistinct, min_, minDistinct
101 -- * Tables
101 -- * Tables
102 , Table (UnsafeTable, renderTable)
102 , Table (UnsafeTable, renderTable)
103 , TypeExpression (UnsafeTypeExpression, renderTypeExpression)
104 , TypeExpression (UnsafeTypeExpression, renderTypeExpression)
104 , PGTyped (pgtype)
105 , PGTyped (pgtype)
@@ -349,12 +350,12 @@ nullIf x y = UnsafeExpression $ "NULL IF" <+> parenthesized
350 :: [Expression tables grouping params ('Null ty)]
351 :: [Expression tables grouping params ('Null ty)]
351 -- ^ array elements
352 -- ^ array elements
352− -> Expression tables grouping params (nullity ('PGarray ty))
353+ -> Expression tables grouping params (nullity ('PGvararray ty))
353array xs = UnsafeExpression $
354array xs = UnsafeExpression $
354 "ARRAY[" <> commaSeparated (renderExpression <$> xs) <> "]"
355 "ARRAY[" <> commaSeparated (renderExpression <$> xs) <> "]"
356instance Monoid
357instance Monoid
357− (Expression tables grouping params (nullity ('PGarray ty))) where
358+ (Expression tables grouping params (nullity ('PGvararray ty))) where
358 mempty = array []
359 mempty = array []
359 mappend = unsafeBinaryOp "||"
360 mappend = unsafeBinaryOp "||"
@@ -1165,14 +1166,14 @@ jsonb = UnsafeTypeExpression "jsonb"
1165-- | variable length array
1166-- | variable length array
1167 :: TypeExpression ('NoDef :=> 'Null pg)
1168 :: TypeExpression ('NoDef :=> 'Null pg)
1168− -> TypeExpression ('NoDef :=> 'Null ('PGarray pg))
1169+ -> TypeExpression ('NoDef :=> 'Null ('PGvararray pg))
1169vararray ty = UnsafeTypeExpression $ renderTypeExpression ty <> "[]"
1170vararray ty = UnsafeTypeExpression $ renderTypeExpression ty <> "[]"
1170-- | fixed length array
1171-- | fixed length array
1172 :: KnownNat n
1173 :: KnownNat n
1173 => proxy n
1174 => proxy n
1174 -> TypeExpression ('NoDef :=> 'Null pg)
1175 -> TypeExpression ('NoDef :=> 'Null pg)
1175− -> TypeExpression ('NoDef :=> 'Null ('PGarrayN n pg))
1176+ -> TypeExpression ('NoDef :=> 'Null ('PGfixarray n pg))
1176fixarray p ty = UnsafeTypeExpression $
1177fixarray p ty = UnsafeTypeExpression $
1177 renderTypeExpression ty <> "[" <> renderNat p <> "]"
1178 renderTypeExpression ty <> "[" <> renderNat p <> "]"
@@ -1216,7 +1217,7 @@ instance PGTyped 'PGinterval where pgtype = interval
1216instance PGTyped 'PGuuid where pgtype = uuid
1217instance PGTyped 'PGuuid where pgtype = uuid
1217instance PGTyped 'PGjson where pgtype = json
1218instance PGTyped 'PGjson where pgtype = json
1218instance PGTyped 'PGjsonb where pgtype = jsonb
1219instance PGTyped 'PGjsonb where pgtype = jsonb
1219−instance PGTyped ty => PGTyped ('PGarray ty) where
1220+instance PGTyped ty => PGTyped ('PGvararray ty) where
1220 pgtype = vararray (pgtype @ty)
1221 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
1222 pgtype = fixarray (Proxy @n) (pgtype @ty)
1223 pgtype = fixarray (Proxy @n) (pgtype @ty)