@@ -511,8 +511,8 @@ newtype AlterTable
511511-- >>> :{
512512-- let
513513-- definition :: Definition
514−-- '["tab" ::: '[] :=> '["col" ::: 'NoDef :=> 'NotNull 'PGint4]]
515−-- '["tab" ::: '["positive" ::: Check '["col"]] :=> '["col" ::: 'NoDef :=> 'NotNull 'PGint4]]
514+-- '["tab" ::: 'Table ('[] :=> '["col" ::: 'NoDef :=> 'NotNull 'PGint4])]
515+-- '["tab" ::: 'Table ('["positive" ::: Check '["col"]] :=> '["col" ::: 'NoDef :=> 'NotNull 'PGint4])]
516516-- definition = alterTable #tab (addConstraint #positive (check (#col :* Nil) (#col .> 0)))
517517-- in renderDefinition definition
518518-- :}
@@ -535,8 +535,8 @@ addConstraint alias constraint = UnsafeAlterTable $
535535-- >>> :{
536536-- let
537537-- definition :: Definition
538−-- '["tab" ::: '["positive" ::: Check '["col"]] :=> '["col" ::: 'NoDef :=> 'NotNull 'PGint4]]
539−-- '["tab" ::: '[] :=> '["col" ::: 'NoDef :=> 'NotNull 'PGint4]]
538+-- '["tab" ::: 'Table ('["positive" ::: Check '["col"]] :=> '["col" ::: 'NoDef :=> 'NotNull 'PGint4])]
539+-- '["tab" ::: 'Table ('[] :=> '["col" ::: 'NoDef :=> 'NotNull 'PGint4])]
540540-- definition = alterTable #tab (dropConstraint #positive)
541541-- in renderDefinition definition
542542-- :}
@@ -560,10 +560,10 @@ class AddColumn ty where
560560 -- >>> :{
561561 -- let
562562 -- definition :: Definition
563− -- '["tab" ::: '[] :=> '["col1" ::: 'NoDef :=> 'Null 'PGint4]]
564− -- '["tab" ::: '[] :=>
563+ -- '["tab" ::: 'Table ('[] :=> '["col1" ::: 'NoDef :=> 'Null 'PGint4])]
564+ -- '["tab" ::: 'Table ('[] :=>
565565 -- '[ "col1" ::: 'NoDef :=> 'Null 'PGint4
566− -- , "col2" ::: 'Def :=> 'Null 'PGtext ]]
566+ -- , "col2" ::: 'Def :=> 'Null 'PGtext ])]
567567 -- definition = alterTable #tab (addColumn #col2 (text & default_ "foo"))
568568 -- in renderDefinition definition
569569 -- :}
@@ -572,10 +572,10 @@ class AddColumn ty where
572572 -- >>> :{
573573 -- let
574574 -- definition :: Definition
575− -- '["tab" ::: '[] :=> '["col1" ::: 'NoDef :=> 'Null 'PGint4]]
576− -- '["tab" ::: '[] :=>
575+ -- '["tab" ::: 'Table ('[] :=> '["col1" ::: 'NoDef :=> 'Null 'PGint4])]
576+ -- '["tab" ::: 'Table ('[] :=>
577577 -- '[ "col1" ::: 'NoDef :=> 'Null 'PGint4
578− -- , "col2" ::: 'NoDef :=> 'Null 'PGtext ]]
578+ -- , "col2" ::: 'NoDef :=> 'Null 'PGtext ])]
579579 -- definition = alterTable #tab (addColumn #col2 text)
580580 -- in renderDefinition definition
581581 -- :}
@@ -601,10 +601,10 @@ instance {-# OVERLAPPABLE #-} AddColumn ('NoDef :=> 'Null ty)
601601-- >>> :{
602602-- let
603603-- definition :: Definition
604−-- '["tab" ::: '[] :=>
604+-- '["tab" ::: 'Table ('[] :=>
605605-- '[ "col1" ::: 'NoDef :=> 'Null 'PGint4
606−-- , "col2" ::: 'NoDef :=> 'Null 'PGtext ]]
607−-- '["tab" ::: '[] :=> '["col1" ::: 'NoDef :=> 'Null 'PGint4]]
606+-- , "col2" ::: 'NoDef :=> 'Null 'PGtext ])]
607+-- '["tab" ::: 'Table ('[] :=> '["col1" ::: 'NoDef :=> 'Null 'PGint4])]
608608-- definition = alterTable #tab (dropColumn #col2)
609609-- in renderDefinition definition
610610-- :}
@@ -624,8 +624,8 @@ dropColumn column = UnsafeAlterTable $
624624-- >>> :{
625625-- let
626626-- definition :: Definition
627−-- '["tab" ::: '[] :=> '["foo" ::: 'NoDef :=> 'Null 'PGint4]]
628−-- '["tab" ::: '[] :=> '["bar" ::: 'NoDef :=> 'Null 'PGint4]]
627+-- '["tab" ::: 'Table ('[] :=> '["foo" ::: 'NoDef :=> 'Null 'PGint4])]
628+-- '["tab" ::: 'Table ('[] :=> '["bar" ::: 'NoDef :=> 'Null 'PGint4])]
629629-- definition = alterTable #tab (renameColumn #foo #bar)
630630-- in renderDefinition definition
631631-- :}
@@ -667,8 +667,8 @@ newtype AlterColumn (ty0 :: ColumnType) (ty1 :: ColumnType) =
667667-- >>> :{
668668-- let
669669-- definition :: Definition
670−-- '["tab" ::: '[] :=> '["col" ::: 'NoDef :=> 'Null 'PGint4]]
671−-- '["tab" ::: '[] :=> '["col" ::: 'Def :=> 'Null 'PGint4]]
670+-- '["tab" ::: 'Table ('[] :=> '["col" ::: 'NoDef :=> 'Null 'PGint4])]
671+-- '["tab" ::: 'Table ('[] :=> '["col" ::: 'Def :=> 'Null 'PGint4])]
672672-- definition = alterTable #tab (alterColumn #col (setDefault 5))
673673-- in renderDefinition definition
674674-- :}
@@ -684,8 +684,8 @@ setDefault expression = UnsafeAlterColumn $
684684-- >>> :{
685685-- let
686686-- definition :: Definition
687−-- '["tab" ::: '[] :=> '["col" ::: 'Def :=> 'Null 'PGint4]]
688−-- '["tab" ::: '[] :=> '["col" ::: 'NoDef :=> 'Null 'PGint4]]
687+-- '["tab" ::: 'Table ('[] :=> '["col" ::: 'Def :=> 'Null 'PGint4])]
688+-- '["tab" ::: 'Table ('[] :=> '["col" ::: 'NoDef :=> 'Null 'PGint4])]
689689-- definition = alterTable #tab (alterColumn #col dropDefault)
690690-- in renderDefinition definition
691691-- :}
@@ -700,8 +700,8 @@ dropDefault = UnsafeAlterColumn $ "DROP DEFAULT"
700700-- >>> :{
701701-- let
702702-- definition :: Definition
703−-- '["tab" ::: '[] :=> '["col" ::: 'NoDef :=> 'Null 'PGint4]]
704−-- '["tab" ::: '[] :=> '["col" ::: 'NoDef :=> 'NotNull 'PGint4]]
703+-- '["tab" ::: 'Table ('[] :=> '["col" ::: 'NoDef :=> 'Null 'PGint4])]
704+-- '["tab" ::: 'Table ('[] :=> '["col" ::: 'NoDef :=> 'NotNull 'PGint4])]
705705-- definition = alterTable #tab (alterColumn #col setNotNull)
706706-- in renderDefinition definition
707707-- :}
@@ -715,8 +715,8 @@ setNotNull = UnsafeAlterColumn $ "SET NOT NULL"
715715-- >>> :{
716716-- let
717717-- definition :: Definition
718−-- '["tab" ::: '[] :=> '["col" ::: 'NoDef :=> 'NotNull 'PGint4]]
719−-- '["tab" ::: '[] :=> '["col" ::: 'NoDef :=> 'Null 'PGint4]]
718+-- '["tab" ::: 'Table ('[] :=> '["col" ::: 'NoDef :=> 'NotNull 'PGint4])]
719+-- '["tab" ::: 'Table ('[] :=> '["col" ::: 'NoDef :=> 'Null 'PGint4])]
720720-- definition = alterTable #tab (alterColumn #col dropNotNull)
721721-- in renderDefinition definition
722722-- :}
@@ -732,8 +732,8 @@ dropNotNull = UnsafeAlterColumn $ "DROP NOT NULL"
732732-- >>> :{
733733-- let
734734-- definition :: Definition
735−-- '["tab" ::: '[] :=> '["col" ::: 'NoDef :=> 'NotNull 'PGint4]]
736−-- '["tab" ::: '[] :=> '["col" ::: 'NoDef :=> 'NotNull 'PGnumeric]]
735+-- '["tab" ::: 'Table ('[] :=> '["col" ::: 'NoDef :=> 'NotNull 'PGint4])]
736+-- '["tab" ::: 'Table ('[] :=> '["col" ::: 'NoDef :=> 'NotNull 'PGnumeric])]
737737-- definition =
738738-- alterTable #tab (alterColumn #col (alterType (numeric & notNull)))
739739-- in renderDefinition definition