@@ -496,7 +496,7 @@ atan2_ y x = UnsafeExpression $
496-- | >>> renderExpression $ true & cast int4
496-- | >>> renderExpression $ true & cast int4
497-- "(TRUE :: int4)"
497-- "(TRUE :: int4)"
499− :: TypeExpression ('[] :=> 'Null ty1)
499+ :: TypeExpression ('NoDef :=> 'Null ty1)
500 -- ^ type to cast as
500 -- ^ type to cast as
501 -> Expression tables grouping params (nullity ty0)
501 -> Expression tables grouping params (nullity ty0)
502 -- ^ value to convert
502 -- ^ value to convert
@@ -997,100 +997,100 @@ newtype TypeExpression (ty :: ColumnType)
997 deriving (GHC.Generic,Show,Eq,Ord,NFData)
997 deriving (GHC.Generic,Show,Eq,Ord,NFData)
999-- | logical Boolean (true/false)
999-- | logical Boolean (true/false)
1000−bool :: TypeExpression ('[] :=> 'Null 'PGbool)
1000+bool :: TypeExpression ('NoDef :=> 'Null 'PGbool)
1001bool = UnsafeTypeExpression "bool"
1001bool = UnsafeTypeExpression "bool"
1002-- | signed two-byte integer
1002-- | signed two-byte integer
1003−int2, smallint :: TypeExpression ('[] :=> 'Null 'PGint2)
1003+int2, smallint :: TypeExpression ('NoDef :=> 'Null 'PGint2)
1004int2 = UnsafeTypeExpression "int2"
1004int2 = UnsafeTypeExpression "int2"
1005smallint = UnsafeTypeExpression "smallint"
1005smallint = UnsafeTypeExpression "smallint"
1006-- | signed four-byte integer
1006-- | signed four-byte integer
1007−int4, int, integer :: TypeExpression ('[] :=> 'Null 'PGint4)
1007+int4, int, integer :: TypeExpression ('NoDef :=> 'Null 'PGint4)
1008int4 = UnsafeTypeExpression "int4"
1008int4 = UnsafeTypeExpression "int4"
1009int = UnsafeTypeExpression "int"
1009int = UnsafeTypeExpression "int"
1010integer = UnsafeTypeExpression "integer"
1010integer = UnsafeTypeExpression "integer"
1011-- | signed eight-byte integer
1011-- | signed eight-byte integer
1012−int8, bigint :: TypeExpression ('[] :=> 'Null 'PGint8)
1012+int8, bigint :: TypeExpression ('NoDef :=> 'Null 'PGint8)
1013int8 = UnsafeTypeExpression "int8"
1013int8 = UnsafeTypeExpression "int8"
1014bigint = UnsafeTypeExpression "bigint"
1014bigint = UnsafeTypeExpression "bigint"
1015-- | arbitrary precision numeric type
1015-- | arbitrary precision numeric type
1016−numeric :: TypeExpression ('[] :=> 'Null 'PGnumeric)
1016+numeric :: TypeExpression ('NoDef :=> 'Null 'PGnumeric)
1017numeric = UnsafeTypeExpression "numeric"
1017numeric = UnsafeTypeExpression "numeric"
1018-- | single precision floating-point number (4 bytes)
1018-- | single precision floating-point number (4 bytes)
1019−float4, real :: TypeExpression ('[] :=> 'Null 'PGfloat4)
1019+float4, real :: TypeExpression ('NoDef :=> 'Null 'PGfloat4)
1020float4 = UnsafeTypeExpression "float4"
1020float4 = UnsafeTypeExpression "float4"
1021real = UnsafeTypeExpression "real"
1021real = UnsafeTypeExpression "real"
1022-- | double precision floating-point number (8 bytes)
1022-- | double precision floating-point number (8 bytes)
1023−float8, doublePrecision :: TypeExpression ('[] :=> 'Null 'PGfloat8)
1023+float8, doublePrecision :: TypeExpression ('NoDef :=> 'Null 'PGfloat8)
1024float8 = UnsafeTypeExpression "float8"
1024float8 = UnsafeTypeExpression "float8"
1025doublePrecision = UnsafeTypeExpression "double precision"
1025doublePrecision = UnsafeTypeExpression "double precision"
1026-- | not a true type, but merely a notational convenience for creating
1026-- | not a true type, but merely a notational convenience for creating
1027-- unique identifier columns with type `'PGint2`
1027-- unique identifier columns with type `'PGint2`
1028serial2, smallserial
1028serial2, smallserial
1029− :: TypeExpression ( AsSet '[ 'Default, 'Unique] :=> 'NotNull 'PGint2)
1029+ :: TypeExpression ('Def :=> 'NotNull 'PGint2)
1030serial2 = UnsafeTypeExpression "serial2"
1030serial2 = UnsafeTypeExpression "serial2"
1031smallserial = UnsafeTypeExpression "smallserial"
1031smallserial = UnsafeTypeExpression "smallserial"
1032-- | not a true type, but merely a notational convenience for creating
1032-- | not a true type, but merely a notational convenience for creating
1033-- unique identifier columns with type `'PGint4`
1033-- unique identifier columns with type `'PGint4`
1034serial4, serial
1034serial4, serial
1035− :: TypeExpression ( AsSet '[ 'Default, 'Unique] :=> 'NotNull 'PGint4)
1035+ :: TypeExpression ('Def :=> 'NotNull 'PGint4)
1036serial4 = UnsafeTypeExpression "serial4"
1036serial4 = UnsafeTypeExpression "serial4"
1037serial = UnsafeTypeExpression "serial"
1037serial = UnsafeTypeExpression "serial"
1038-- | not a true type, but merely a notational convenience for creating
1038-- | not a true type, but merely a notational convenience for creating
1039-- unique identifier columns with type `'PGint8`
1039-- unique identifier columns with type `'PGint8`
1040serial8, bigserial
1040serial8, bigserial
1041− :: TypeExpression ( AsSet '[ 'Default, 'Unique] :=> 'NotNull 'PGint8)
1041+ :: TypeExpression ('Def :=> 'NotNull 'PGint8)
1042serial8 = UnsafeTypeExpression "serial8"
1042serial8 = UnsafeTypeExpression "serial8"
1043bigserial = UnsafeTypeExpression "bigserial"
1043bigserial = UnsafeTypeExpression "bigserial"
1044-- | variable-length character string
1044-- | variable-length character string
1045−text :: TypeExpression ('[] :=> 'Null 'PGtext)
1045+text :: TypeExpression ('NoDef :=> 'Null 'PGtext)
1046text = UnsafeTypeExpression "text"
1046text = UnsafeTypeExpression "text"
1047-- | fixed-length character string
1047-- | fixed-length character string
1048char, character
1048char, character
1049 :: (KnownNat n, 1 <= n)
1049 :: (KnownNat n, 1 <= n)
1050 => proxy n
1050 => proxy n
1051− -> TypeExpression ('[] :=> 'Null ('PGchar n))
1051+ -> TypeExpression ('NoDef :=> 'Null ('PGchar n))
1052char p = UnsafeTypeExpression $ "char(" <> renderNat p <> ")"
1052char p = UnsafeTypeExpression $ "char(" <> renderNat p <> ")"
1053character p = UnsafeTypeExpression $ "character(" <> renderNat p <> ")"
1053character p = UnsafeTypeExpression $ "character(" <> renderNat p <> ")"
1054-- | variable-length character string
1054-- | variable-length character string
1055varchar, characterVarying
1055varchar, characterVarying
1056 :: (KnownNat n, 1 <= n)
1056 :: (KnownNat n, 1 <= n)
1057 => proxy n
1057 => proxy n
1058− -> TypeExpression ('[] :=> 'Null ('PGvarchar n))
1058+ -> TypeExpression ('NoDef :=> 'Null ('PGvarchar n))
1059varchar p = UnsafeTypeExpression $ "varchar(" <> renderNat p <> ")"
1059varchar p = UnsafeTypeExpression $ "varchar(" <> renderNat p <> ")"
1060characterVarying p = UnsafeTypeExpression $
1060characterVarying p = UnsafeTypeExpression $
1061 "character varying(" <> renderNat p <> ")"
1061 "character varying(" <> renderNat p <> ")"
1062-- | binary data ("byte array")
1062-- | binary data ("byte array")
1063−bytea :: TypeExpression ('[] :=> 'Null 'PGbytea)
1063+bytea :: TypeExpression ('NoDef :=> 'Null 'PGbytea)
1064bytea = UnsafeTypeExpression "bytea"
1064bytea = UnsafeTypeExpression "bytea"
1065-- | date and time (no time zone)
1065-- | date and time (no time zone)
1066−timestamp :: TypeExpression ('[] :=> 'Null 'PGtimestamp)
1066+timestamp :: TypeExpression ('NoDef :=> 'Null 'PGtimestamp)
1067timestamp = UnsafeTypeExpression "timestamp"
1067timestamp = UnsafeTypeExpression "timestamp"
1068-- | date and time, including time zone
1068-- | date and time, including time zone
1069−timestampWithTimeZone :: TypeExpression ('[] :=> 'Null 'PGtimestamptz)
1069+timestampWithTimeZone :: TypeExpression ('NoDef :=> 'Null 'PGtimestamptz)
1070timestampWithTimeZone = UnsafeTypeExpression "timestamp with time zone"
1070timestampWithTimeZone = UnsafeTypeExpression "timestamp with time zone"
1071-- | calendar date (year, month, day)
1071-- | calendar date (year, month, day)
1072−date :: TypeExpression ('[] :=> 'Null 'PGdate)
1072+date :: TypeExpression ('NoDef :=> 'Null 'PGdate)
1073date = UnsafeTypeExpression "date"
1073date = UnsafeTypeExpression "date"
1074-- | time of day (no time zone)
1074-- | time of day (no time zone)
1075−time :: TypeExpression ('[] :=> 'Null 'PGtime)
1075+time :: TypeExpression ('NoDef :=> 'Null 'PGtime)
1076time = UnsafeTypeExpression "time"
1076time = UnsafeTypeExpression "time"
1077-- | time of day, including time zone
1077-- | time of day, including time zone
1078−timeWithTimeZone :: TypeExpression ('[] :=> 'Null 'PGtimetz)
1078+timeWithTimeZone :: TypeExpression ('NoDef :=> 'Null 'PGtimetz)
1079timeWithTimeZone = UnsafeTypeExpression "time with time zone"
1079timeWithTimeZone = UnsafeTypeExpression "time with time zone"
1080-- | time span
1080-- | time span
1081−interval :: TypeExpression ('[] :=> 'Null 'PGinterval)
1081+interval :: TypeExpression ('NoDef :=> 'Null 'PGinterval)
1082interval = UnsafeTypeExpression "interval"
1082interval = UnsafeTypeExpression "interval"
1083-- | universally unique identifier
1083-- | universally unique identifier
1084−uuid :: TypeExpression ('[] :=> 'Null 'PGuuid)
1084+uuid :: TypeExpression ('NoDef :=> 'Null 'PGuuid)
1085uuid = UnsafeTypeExpression "uuid"
1085uuid = UnsafeTypeExpression "uuid"
1086-- | IPv4 or IPv6 host address
1086-- | IPv4 or IPv6 host address
1087−inet :: TypeExpression ('[] :=> 'Null 'PGinet)
1087+inet :: TypeExpression ('NoDef :=> 'Null 'PGinet)
1088inet = UnsafeTypeExpression "inet"
1088inet = UnsafeTypeExpression "inet"
1089-- | textual JSON data
1089-- | textual JSON data
1090−json :: TypeExpression ('[] :=> 'Null 'PGjson)
1090+json :: TypeExpression ('NoDef :=> 'Null 'PGjson)
1091json = UnsafeTypeExpression "json"
1091json = UnsafeTypeExpression "json"
1092-- | binary JSON data, decomposed
1092-- | binary JSON data, decomposed
1093−jsonb :: TypeExpression ('[] :=> 'Null 'PGjsonb)
1093+jsonb :: TypeExpression ('NoDef :=> 'Null 'PGjsonb)
1094jsonb = UnsafeTypeExpression "jsonb"
1094jsonb = UnsafeTypeExpression "jsonb"
1096-- | used in `createTable` commands as a column constraint to ensure
1096-- | used in `createTable` commands as a column constraint to ensure
@@ -1103,14 +1103,14 @@ notNull ty = UnsafeTypeExpression $ renderTypeExpression ty <+> "NOT NULL"
1103-- | used in `createTable` commands as a column constraint to give a default
1103-- | used in `createTable` commands as a column constraint to give a default
1105 :: Expression '[] 'Ungrouped '[] ty
1105 :: Expression '[] 'Ungrouped '[] ty
1106− -> TypeExpression (constraints :=> ty)
1106+ -> TypeExpression ('NoDef :=> ty)
1107− -> TypeExpression (AsSet ('Default ': constraints) :=> ty)
1107+ -> TypeExpression ('Def :=> ty)
1108default_ x ty = UnsafeTypeExpression $
1108default_ x ty = UnsafeTypeExpression $
1109 renderTypeExpression ty <+> "DEFAULT" <+> renderExpression x
1109 renderTypeExpression ty <+> "DEFAULT" <+> renderExpression x
1111-- | `pgtype` is a demoted version of a `PGType`
1111-- | `pgtype` is a demoted version of a `PGType`
1112class PGTyped (ty :: PGType) where
1112class PGTyped (ty :: PGType) where
1113− pgtype :: TypeExpression ('[] :=> 'Null ty)
1113+ pgtype :: TypeExpression ('NoDef :=> 'Null ty)
1114instance PGTyped 'PGbool where pgtype = bool
1114instance PGTyped 'PGbool where pgtype = bool
1115instance PGTyped 'PGint2 where pgtype = int2
1115instance PGTyped 'PGint2 where pgtype = int2
1116instance PGTyped 'PGint4 where pgtype = int4
1116instance PGTyped 'PGint4 where pgtype = int4