on dev help sign in
argument docstrings
1b0f63aEitan Chatav
squeal-postgresql/src/Squeal/PostgreSQL/Definition.hs+7
@@ -806,7 +806,9 @@ dropView v = UnsafeDefinition $ "DROP VIEW" <+> renderAlias v <> ";"
806createTypeEnum
806createTypeEnum
807 :: (KnownSymbol enum, SOP.All KnownSymbol labels)
807 :: (KnownSymbol enum, SOP.All KnownSymbol labels)
808 => Alias enum
808 => Alias enum
809+ -- ^ name of the user defined enumerated type
809 -> NP PGlabel labels
810 -> NP PGlabel labels
811+ -- ^ labels of the enumerated type
810 -> Definition schema (Create enum ('Typedef ('PGenum labels)) schema)
812 -> Definition schema (Create enum ('Typedef ('PGenum labels)) schema)
811createTypeEnum enum labels = UnsafeDefinition $
813createTypeEnum enum labels = UnsafeDefinition $
812 "CREATE" <+> "TYPE" <+> renderAlias enum <+> "AS" <+>
814 "CREATE" <+> "TYPE" <+> renderAlias enum <+> "AS" <+>
@@ -826,6 +828,7 @@ createTypeEnumWith
826 , KnownSymbol enum
828 , KnownSymbol enum
827 )
829 )
828 => Alias enum
830 => Alias enum
831+ -- ^ name of the user defined enumerated type
829 -> Definition schema (Create enum ('Typedef (EnumWith hask)) schema)
832 -> Definition schema (Create enum ('Typedef (EnumWith hask)) schema)
830createTypeEnumWith enum = createTypeEnum enum
833createTypeEnumWith enum = createTypeEnum enum
831 (SOP.hpure label :: NP PGlabel (LabelsWith hask))
834 (SOP.hpure label :: NP PGlabel (LabelsWith hask))
@@ -838,7 +841,9 @@ createTypeEnumWith enum = createTypeEnum enum
838createTypeComposite
841createTypeComposite
839 :: (KnownSymbol ty, SOP.SListI fields)
842 :: (KnownSymbol ty, SOP.SListI fields)
840 => Alias ty
843 => Alias ty
844+ -- ^ name of the user defined composite type
841 -> NP (Aliased TypeExpression) fields
845 -> NP (Aliased TypeExpression) fields
846+ -- ^ list of attribute names and data types
842 -> Definition schema (Create ty ('Typedef ('PGcomposite fields)) schema)
847 -> Definition schema (Create ty ('Typedef ('PGcomposite fields)) schema)
843createTypeComposite ty fields = UnsafeDefinition $
848createTypeComposite ty fields = UnsafeDefinition $
844 "CREATE" <+> "TYPE" <+> renderAlias ty <+> "AS" <+> parenthesized
849 "CREATE" <+> "TYPE" <+> renderAlias ty <+> "AS" <+> parenthesized
@@ -858,6 +863,7 @@ createTypeCompositeWith
858 , KnownSymbol ty
863 , KnownSymbol ty
859 )
864 )
860 => Alias ty
865 => Alias ty
866+ -- ^ name of the user defined composite type
861 -> Definition schema (Create ty ( 'Typedef (CompositeWith hask)) schema)
867 -> Definition schema (Create ty ( 'Typedef (CompositeWith hask)) schema)
862createTypeCompositeWith ty = createTypeComposite ty $ zipAs
868createTypeCompositeWith ty = createTypeComposite ty $ zipAs
863 (SOP.hpure Alias :: NP Alias (FieldNamesWith hask))
869 (SOP.hpure Alias :: NP Alias (FieldNamesWith hask))
@@ -874,6 +880,7 @@ createTypeCompositeWith ty = createTypeComposite ty $ zipAs
874dropType
880dropType
875 :: Has tydef schema ('Typedef ty)
881 :: Has tydef schema ('Typedef ty)
876 => Alias tydef
882 => Alias tydef
883+ -- ^ name of the user defined type
877 -> Definition schema (Drop tydef schema)
884 -> Definition schema (Drop tydef schema)
878dropType tydef = UnsafeDefinition $ "DROP" <+> "TYPE" <+> renderAlias tydef <> ";"
885dropType tydef = UnsafeDefinition $ "DROP" <+> "TYPE" <+> renderAlias tydef <> ";"
879
886