on dev help sign in
remove RelationToNullityTypes
c1968c4Eitan Chatav
squeal-postgresql/src/Squeal/PostgreSQL/Query.hs+3−3
@@ -956,7 +956,7 @@ leftOuterJoin
956 -- ^ @on@ condition
956 -- ^ @on@ condition
957 -> FromClause schema params left
957 -> FromClause schema params left
958 -- ^ left
958 -- ^ left
959− -> FromClause schema params (Join left (NullifyRelations right))
959+ -> FromClause schema params (Join left (NullifyFrom right))
960leftOuterJoin right on left = UnsafeFromClause $
960leftOuterJoin right on left = UnsafeFromClause $
961 renderFromClause left <+> "LEFT OUTER JOIN" <+> renderFromClause right
961 renderFromClause left <+> "LEFT OUTER JOIN" <+> renderFromClause right
962 <+> "ON" <+> renderExpression on
962 <+> "ON" <+> renderExpression on
@@ -974,7 +974,7 @@ rightOuterJoin
974 -- ^ @on@ condition
974 -- ^ @on@ condition
975 -> FromClause schema params left
975 -> FromClause schema params left
976 -- ^ left
976 -- ^ left
977− -> FromClause schema params (Join (NullifyRelations left) right)
977+ -> FromClause schema params (Join (NullifyFrom left) right)
978rightOuterJoin right on left = UnsafeFromClause $
978rightOuterJoin right on left = UnsafeFromClause $
979 renderFromClause left <+> "RIGHT OUTER JOIN" <+> renderFromClause right
979 renderFromClause left <+> "RIGHT OUTER JOIN" <+> renderFromClause right
980 <+> "ON" <+> renderExpression on
980 <+> "ON" <+> renderExpression on
@@ -994,7 +994,7 @@ fullOuterJoin
994 -> FromClause schema params left
994 -> FromClause schema params left
995 -- ^ left
995 -- ^ left
996 -> FromClause schema params
996 -> FromClause schema params
997− (Join (NullifyRelations left) (NullifyRelations right))
997+ (Join (NullifyFrom left) (NullifyFrom right))
998fullOuterJoin right on left = UnsafeFromClause $
998fullOuterJoin right on left = UnsafeFromClause $
999 renderFromClause left <+> "FULL OUTER JOIN" <+> renderFromClause right
999 renderFromClause left <+> "FULL OUTER JOIN" <+> renderFromClause right
1000 <+> "ON" <+> renderExpression on
1000 <+> "ON" <+> renderExpression on
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+13−19
@@ -98,12 +98,11 @@ module Squeal.PostgreSQL.Schema
98 , AllNotNull
98 , AllNotNull
99 , NotAllNull
99 , NotAllNull
100 , NullifyType
100 , NullifyType
101− , NullifyRelation
101+ , NullifyRow
102− , NullifyRelations
102+ , NullifyFrom
103 , ColumnsToRow
103 , ColumnsToRow
104 , TableToColumns
104 , TableToColumns
105 , TableToRow
105 , TableToRow
106− , RelationToNullityTypes
107 , ConstraintInvolves
106 , ConstraintInvolves
108 , DropIfConstraintsInvolve
107 , DropIfConstraintsInvolve
109 -- ** JSON support
108 -- ** JSON support
@@ -564,29 +563,24 @@ type family NotAllNull (columns :: ColumnsType) :: Constraint where
564 NotAllNull (column ::: def :=> 'NotNull ty ': columns) = ()
563 NotAllNull (column ::: def :=> 'NotNull ty ': columns) = ()
565 NotAllNull (column ::: def :=> 'Null ty ': columns) = NotAllNull columns
564 NotAllNull (column ::: def :=> 'Null ty ': columns) = NotAllNull columns
566
565
567−-- | `NullifyType` is an idempotent that nullifies a `ColumnType`.
566+-- | `NullifyType` is an idempotent that nullifies a `NullityType`.
568type family NullifyType (ty :: NullityType) :: NullityType where
567type family NullifyType (ty :: NullityType) :: NullityType where
569 NullifyType ('Null ty) = 'Null ty
568 NullifyType ('Null ty) = 'Null ty
570 NullifyType ('NotNull ty) = 'Null ty
569 NullifyType ('NotNull ty) = 'Null ty
571
570
572−-- | `NullifyRelation` is an idempotent that nullifies a `ColumnsType`.
571+-- | `NullifyRow` is an idempotent that nullifies a `RowType`.
573−type family NullifyRelation (columns :: RowType) :: RowType where
572+type family NullifyRow (columns :: RowType) :: RowType where
574− NullifyRelation '[] = '[]
573+ NullifyRow '[] = '[]
575− NullifyRelation (column ::: ty ': columns) =
574+ NullifyRow (column ::: ty ': columns) =
576− column ::: NullifyType ty ': NullifyRelation columns
575+ column ::: NullifyType ty ': NullifyRow columns
577
576
578−-- | `NullifyRelations` is an idempotent that nullifies a `FromType`
577+-- | `NullifyFrom` is an idempotent that nullifies a `FromType`
579-- used to nullify the left or right hand side of an outer join
578-- used to nullify the left or right hand side of an outer join
580-- in a `Squeal.PostgreSQL.Query.FromClause`.
579-- in a `Squeal.PostgreSQL.Query.FromClause`.
581−type family NullifyRelations (tables :: FromType) :: FromType where
580+type family NullifyFrom (tables :: FromType) :: FromType where
582− NullifyRelations '[] = '[]
581+ NullifyFrom '[] = '[]
583− NullifyRelations (table ::: columns ': tables) =
582+ NullifyFrom (table ::: columns ': tables) =
584− table ::: NullifyRelation columns ': NullifyRelations tables
583+ table ::: NullifyRow columns ': NullifyFrom tables
585−
586−-- | `RelationToNullityTypes` drops the column constraints.
587−type family RelationToNullityTypes (rel :: RowType) :: [NullityType] where
588− RelationToNullityTypes ('(k, x) : xs) = x : RelationToNullityTypes xs
589− RelationToNullityTypes '[] = '[]
590
584
591-- | `Join` is simply promoted `++` and is used in @JOIN@s in
585-- | `Join` is simply promoted `++` and is used in @JOIN@s in
592-- `Squeal.PostgreSQL.Query.FromClause`s.
586-- `Squeal.PostgreSQL.Query.FromClause`s.