@@ -151,7 +151,8 @@ createTable tab columns constraints = UnsafeDefinition $
152{-| `createTableIfNotExists` creates a table if it doesn't exist, but does not add it to the schema.
152{-| `createTableIfNotExists` creates a table if it doesn't exist, but does not add it to the schema.
153Instead, the schema already has the table so if the table did not yet exist, the schema was wrong.
153Instead, the schema already has the table so if the table did not yet exist, the schema was wrong.
154−`createTableIfNotExists` fixes this. Interestingly, this property makes it an idempotent in the `Category` `Definition`.
154+`createTableIfNotExists` fixes this. Interestingly, this property makes it an idempotent in
155+the `Category` of `Definition`s.
156>>> :set -XOverloadedLabels -XTypeApplications
157>>> :set -XOverloadedLabels -XTypeApplications
157>>> type Table = '[] :=> '["a" ::: 'NoDef :=> 'Null 'PGint4, "b" ::: 'NoDef :=> 'Null 'PGfloat4]
158>>> type Table = '[] :=> '["a" ::: 'NoDef :=> 'Null 'PGint4, "b" ::: 'NoDef :=> 'Null 'PGfloat4]
@@ -789,7 +790,7 @@ alterType ty = UnsafeAlterColumn $ "TYPE" <+> renderColumnTypeExpression ty
789-- CREATE VIEW "bc" AS SELECT "b" AS "b", "c" AS "c" FROM "abc" AS "abc";
790-- CREATE VIEW "bc" AS SELECT "b" AS "b", "c" AS "c" FROM "abc" AS "abc";
790createView
791createView
791 :: KnownSymbol view
792 :: KnownSymbol view
792− => Alias view -- ^ the name of the table to add
793+ => Alias view -- ^ the name of the view to add
793 -> Query schema '[] relation
794 -> Query schema '[] relation
794 -- ^ query
795 -- ^ query
795 -> Definition schema (Create view ('View relation) schema)
796 -> Definition schema (Create view ('View relation) schema)
@@ -932,19 +933,19 @@ default_ x ty = UnsafeColumnTypeExpression $
932 renderColumnTypeExpression ty <+> "DEFAULT" <+> renderExpression x
933 renderColumnTypeExpression ty <+> "DEFAULT" <+> renderExpression x
934-- | not a true type, but merely a notational convenience for creating
935-- | not a true type, but merely a notational convenience for creating
935−-- unique identifier columns with type `'PGint2`
936+-- unique identifier columns with type `PGint2`
936serial2, smallserial
937serial2, smallserial
937 :: ColumnTypeExpression schema ('Def :=> 'NotNull 'PGint2)
938 :: ColumnTypeExpression schema ('Def :=> 'NotNull 'PGint2)
938serial2 = UnsafeColumnTypeExpression "serial2"
939serial2 = UnsafeColumnTypeExpression "serial2"
939smallserial = UnsafeColumnTypeExpression "smallserial"
940smallserial = UnsafeColumnTypeExpression "smallserial"
940-- | not a true type, but merely a notational convenience for creating
941-- | not a true type, but merely a notational convenience for creating
941−-- unique identifier columns with type `'PGint4`
942+-- unique identifier columns with type `PGint4`
942serial4, serial
943serial4, serial
943 :: ColumnTypeExpression schema ('Def :=> 'NotNull 'PGint4)
944 :: ColumnTypeExpression schema ('Def :=> 'NotNull 'PGint4)
944serial4 = UnsafeColumnTypeExpression "serial4"
945serial4 = UnsafeColumnTypeExpression "serial4"
945serial = UnsafeColumnTypeExpression "serial"
946serial = UnsafeColumnTypeExpression "serial"
946-- | not a true type, but merely a notational convenience for creating
947-- | not a true type, but merely a notational convenience for creating
947−-- unique identifier columns with type `'PGint8`
948+-- unique identifier columns with type `PGint8`
948serial8, bigserial
949serial8, bigserial
949 :: ColumnTypeExpression schema ('Def :=> 'NotNull 'PGint8)
950 :: ColumnTypeExpression schema ('Def :=> 'NotNull 'PGint8)
950serial8 = UnsafeColumnTypeExpression "serial8"
951serial8 = UnsafeColumnTypeExpression "serial8"