on dev help sign in
arrayN ~> fixarray
commitf9b75813d39054c9159f3ce88f1ddfed26c89993 authorEitan Chatav <eitan.chatav@gmail.com> dateFri 23 Feb 2018, 15:56 (9 years ago) parenta19d51e
2 files changed+5−5
squeal-postgresql/exe/Example.hs+1−1 squeal-postgresql/src/Squeal/PostgreSQL/Expression.hs+4−4
squeal-postgresql/exe/Example.hs+1−1
@@ -46,7 +46,7 @@ setup =
4646 createTable #users
4747 ( serial `As` #id :*
4848 (text & notNull) `As` #name :*
49− (array int2 & notNull) `As` #vec :* Nil )
49+ (vararray int2 & notNull) `As` #vec :* Nil )
5050 ( primaryKey (Column #id :* Nil) `As` #pk_users :* Nil )
5151 >>>
5252 createTable #emails
squeal-postgresql/src/Squeal/PostgreSQL/Expression.hs+4−4
@@ -138,7 +138,7 @@ module Squeal.PostgreSQL.Expression
138138 , json
139139 , jsonb
140140 , vararray
141− , arrayN
141+ , fixarray
142142 , notNull
143143 , default_
144144 -- * Re-export
@@ -1164,12 +1164,12 @@ vararray
11641164 -> TypeExpression ('NoDef :=> 'Null ('PGarray pg))
11651165vararray ty = UnsafeTypeExpression $ renderTypeExpression ty <> "[]"
11661166-- | fixed length array
1167−arrayN
1167+fixarray
11681168 :: KnownNat n
11691169 => proxy n
11701170 -> TypeExpression ('NoDef :=> 'Null pg)
11711171 -> TypeExpression ('NoDef :=> 'Null ('PGarrayN n pg))
1172−arrayN p ty = UnsafeTypeExpression $
1172+fixarray p ty = UnsafeTypeExpression $
11731173 renderTypeExpression ty <> "[" <> renderNat p <> "]"
11741174
11751175-- | used in `createTable` commands as a column constraint to ensure
@@ -1215,4 +1215,4 @@ instance PGTyped 'PGjsonb where pgtype = jsonb
12151215instance PGTyped ty => PGTyped ('PGarray ty) where
12161216 pgtype = vararray (pgtype @ty)
12171217instance (KnownNat n, PGTyped ty) => PGTyped ('PGarrayN n ty) where
1218− pgtype = arrayN (Proxy @n) (pgtype @ty)
1218+ pgtype = fixarray (Proxy @n) (pgtype @ty)