@@ -496,7 +496,7 @@ atan2_ y x = UnsafeExpression $
496496-- | >>> renderExpression $ true & cast int4
497497-- "(TRUE :: int4)"
498498cast
499− :: TypeExpression ('[] :=> 'Null ty1)
499+ :: TypeExpression ('NoDef :=> 'Null ty1)
500500 -- ^ type to cast as
501501 -> Expression tables grouping params (nullity ty0)
502502 -- ^ value to convert
@@ -997,100 +997,100 @@ newtype TypeExpression (ty :: ColumnType)
997997 deriving (GHC.Generic,Show,Eq,Ord,NFData)
998998
999999-- | logical Boolean (true/false)
1000−bool :: TypeExpression ('[] :=> 'Null 'PGbool)
1000+bool :: TypeExpression ('NoDef :=> 'Null 'PGbool)
10011001bool = UnsafeTypeExpression "bool"
10021002-- | signed two-byte integer
1003−int2, smallint :: TypeExpression ('[] :=> 'Null 'PGint2)
1003+int2, smallint :: TypeExpression ('NoDef :=> 'Null 'PGint2)
10041004int2 = UnsafeTypeExpression "int2"
10051005smallint = UnsafeTypeExpression "smallint"
10061006-- | signed four-byte integer
1007−int4, int, integer :: TypeExpression ('[] :=> 'Null 'PGint4)
1007+int4, int, integer :: TypeExpression ('NoDef :=> 'Null 'PGint4)
10081008int4 = UnsafeTypeExpression "int4"
10091009int = UnsafeTypeExpression "int"
10101010integer = UnsafeTypeExpression "integer"
10111011-- | signed eight-byte integer
1012−int8, bigint :: TypeExpression ('[] :=> 'Null 'PGint8)
1012+int8, bigint :: TypeExpression ('NoDef :=> 'Null 'PGint8)
10131013int8 = UnsafeTypeExpression "int8"
10141014bigint = UnsafeTypeExpression "bigint"
10151015-- | arbitrary precision numeric type
1016−numeric :: TypeExpression ('[] :=> 'Null 'PGnumeric)
1016+numeric :: TypeExpression ('NoDef :=> 'Null 'PGnumeric)
10171017numeric = UnsafeTypeExpression "numeric"
10181018-- | single precision floating-point number (4 bytes)
1019−float4, real :: TypeExpression ('[] :=> 'Null 'PGfloat4)
1019+float4, real :: TypeExpression ('NoDef :=> 'Null 'PGfloat4)
10201020float4 = UnsafeTypeExpression "float4"
10211021real = UnsafeTypeExpression "real"
10221022-- | double precision floating-point number (8 bytes)
1023−float8, doublePrecision :: TypeExpression ('[] :=> 'Null 'PGfloat8)
1023+float8, doublePrecision :: TypeExpression ('NoDef :=> 'Null 'PGfloat8)
10241024float8 = UnsafeTypeExpression "float8"
10251025doublePrecision = UnsafeTypeExpression "double precision"
10261026-- | not a true type, but merely a notational convenience for creating
10271027-- unique identifier columns with type `'PGint2`
10281028serial2, smallserial
1029− :: TypeExpression ( AsSet '[ 'Default, 'Unique] :=> 'NotNull 'PGint2)
1029+ :: TypeExpression ('Def :=> 'NotNull 'PGint2)
10301030serial2 = UnsafeTypeExpression "serial2"
10311031smallserial = UnsafeTypeExpression "smallserial"
10321032-- | not a true type, but merely a notational convenience for creating
10331033-- unique identifier columns with type `'PGint4`
10341034serial4, serial
1035− :: TypeExpression ( AsSet '[ 'Default, 'Unique] :=> 'NotNull 'PGint4)
1035+ :: TypeExpression ('Def :=> 'NotNull 'PGint4)
10361036serial4 = UnsafeTypeExpression "serial4"
10371037serial = UnsafeTypeExpression "serial"
10381038-- | not a true type, but merely a notational convenience for creating
10391039-- unique identifier columns with type `'PGint8`
10401040serial8, bigserial
1041− :: TypeExpression ( AsSet '[ 'Default, 'Unique] :=> 'NotNull 'PGint8)
1041+ :: TypeExpression ('Def :=> 'NotNull 'PGint8)
10421042serial8 = UnsafeTypeExpression "serial8"
10431043bigserial = UnsafeTypeExpression "bigserial"
10441044-- | variable-length character string
1045−text :: TypeExpression ('[] :=> 'Null 'PGtext)
1045+text :: TypeExpression ('NoDef :=> 'Null 'PGtext)
10461046text = UnsafeTypeExpression "text"
10471047-- | fixed-length character string
10481048char, character
10491049 :: (KnownNat n, 1 <= n)
10501050 => proxy n
1051− -> TypeExpression ('[] :=> 'Null ('PGchar n))
1051+ -> TypeExpression ('NoDef :=> 'Null ('PGchar n))
10521052char p = UnsafeTypeExpression $ "char(" <> renderNat p <> ")"
10531053character p = UnsafeTypeExpression $ "character(" <> renderNat p <> ")"
10541054-- | variable-length character string
10551055varchar, characterVarying
10561056 :: (KnownNat n, 1 <= n)
10571057 => proxy n
1058− -> TypeExpression ('[] :=> 'Null ('PGvarchar n))
1058+ -> TypeExpression ('NoDef :=> 'Null ('PGvarchar n))
10591059varchar p = UnsafeTypeExpression $ "varchar(" <> renderNat p <> ")"
10601060characterVarying p = UnsafeTypeExpression $
10611061 "character varying(" <> renderNat p <> ")"
10621062-- | binary data ("byte array")
1063−bytea :: TypeExpression ('[] :=> 'Null 'PGbytea)
1063+bytea :: TypeExpression ('NoDef :=> 'Null 'PGbytea)
10641064bytea = UnsafeTypeExpression "bytea"
10651065-- | date and time (no time zone)
1066−timestamp :: TypeExpression ('[] :=> 'Null 'PGtimestamp)
1066+timestamp :: TypeExpression ('NoDef :=> 'Null 'PGtimestamp)
10671067timestamp = UnsafeTypeExpression "timestamp"
10681068-- | date and time, including time zone
1069−timestampWithTimeZone :: TypeExpression ('[] :=> 'Null 'PGtimestamptz)
1069+timestampWithTimeZone :: TypeExpression ('NoDef :=> 'Null 'PGtimestamptz)
10701070timestampWithTimeZone = UnsafeTypeExpression "timestamp with time zone"
10711071-- | calendar date (year, month, day)
1072−date :: TypeExpression ('[] :=> 'Null 'PGdate)
1072+date :: TypeExpression ('NoDef :=> 'Null 'PGdate)
10731073date = UnsafeTypeExpression "date"
10741074-- | time of day (no time zone)
1075−time :: TypeExpression ('[] :=> 'Null 'PGtime)
1075+time :: TypeExpression ('NoDef :=> 'Null 'PGtime)
10761076time = UnsafeTypeExpression "time"
10771077-- | time of day, including time zone
1078−timeWithTimeZone :: TypeExpression ('[] :=> 'Null 'PGtimetz)
1078+timeWithTimeZone :: TypeExpression ('NoDef :=> 'Null 'PGtimetz)
10791079timeWithTimeZone = UnsafeTypeExpression "time with time zone"
10801080-- | time span
1081−interval :: TypeExpression ('[] :=> 'Null 'PGinterval)
1081+interval :: TypeExpression ('NoDef :=> 'Null 'PGinterval)
10821082interval = UnsafeTypeExpression "interval"
10831083-- | universally unique identifier
1084−uuid :: TypeExpression ('[] :=> 'Null 'PGuuid)
1084+uuid :: TypeExpression ('NoDef :=> 'Null 'PGuuid)
10851085uuid = UnsafeTypeExpression "uuid"
10861086-- | IPv4 or IPv6 host address
1087−inet :: TypeExpression ('[] :=> 'Null 'PGinet)
1087+inet :: TypeExpression ('NoDef :=> 'Null 'PGinet)
10881088inet = UnsafeTypeExpression "inet"
10891089-- | textual JSON data
1090−json :: TypeExpression ('[] :=> 'Null 'PGjson)
1090+json :: TypeExpression ('NoDef :=> 'Null 'PGjson)
10911091json = UnsafeTypeExpression "json"
10921092-- | binary JSON data, decomposed
1093−jsonb :: TypeExpression ('[] :=> 'Null 'PGjsonb)
1093+jsonb :: TypeExpression ('NoDef :=> 'Null 'PGjsonb)
10941094jsonb = UnsafeTypeExpression "jsonb"
10951095
10961096-- | used in `createTable` commands as a column constraint to ensure
@@ -1103,14 +1103,14 @@ notNull ty = UnsafeTypeExpression $ renderTypeExpression ty <+> "NOT NULL"
11031103-- | used in `createTable` commands as a column constraint to give a default
11041104default_
11051105 :: Expression '[] 'Ungrouped '[] ty
1106− -> TypeExpression (constraints :=> ty)
1107− -> TypeExpression (AsSet ('Default ': constraints) :=> ty)
1106+ -> TypeExpression ('NoDef :=> ty)
1107+ -> TypeExpression ('Def :=> ty)
11081108default_ x ty = UnsafeTypeExpression $
11091109 renderTypeExpression ty <+> "DEFAULT" <+> renderExpression x
11101110
11111111-- | `pgtype` is a demoted version of a `PGType`
11121112class PGTyped (ty :: PGType) where
1113− pgtype :: TypeExpression ('[] :=> 'Null ty)
1113+ pgtype :: TypeExpression ('NoDef :=> 'Null ty)
11141114instance PGTyped 'PGbool where pgtype = bool
11151115instance PGTyped 'PGint2 where pgtype = int2
11161116instance PGTyped 'PGint4 where pgtype = int4