@@ -36,13 +36,13 @@ import GHC.TypeLits ( Symbol, KnownSymbol )
36import Prelude
36import Prelude
39−import Rel8.Aggregate ( Aggregate )
39+import Rel8.Aggregate ( Aggregate, Col(..) )
40−import Rel8.Expr ( Expr )
40+import Rel8.Expr ( Expr, Col(..) )
41import Rel8.Kind.Necessity
41import Rel8.Kind.Necessity
42 ( SNecessity( SRequired, SOptional )
42 ( SNecessity( SRequired, SOptional )
43 , KnownNecessity, necessitySing
43 , KnownNecessity, necessitySing
45−import Rel8.Schema.Context
45+import Rel8.Schema.Context ( Col(..) )
46import Rel8.Schema.Context.Identity
46import Rel8.Schema.Context.Identity
47 ( fromHEitherTable, toHEitherTable
47 ( fromHEitherTable, toHEitherTable
48 , fromHListTable, toHListTable
48 , fromHListTable, toHListTable
@@ -68,7 +68,9 @@ import Rel8.Schema.HTable.Quintet ( HQuintet(..) )
68import Rel8.Schema.HTable.These ( HTheseTable )
68import Rel8.Schema.HTable.These ( HTheseTable )
69import Rel8.Schema.HTable.Trio ( HTrio(..) )
69import Rel8.Schema.HTable.Trio ( HTrio(..) )
70import Rel8.Schema.HTable.Vectorize ( hrelabel )
70import Rel8.Schema.HTable.Vectorize ( hrelabel )
71+import Rel8.Schema.Insert ( Insert, Col(..) )
71import qualified Rel8.Schema.Kind as K
72import qualified Rel8.Schema.Kind as K
73+import Rel8.Schema.Name ( Name( Name ), Col(..) )
72import Rel8.Schema.Spec ( Spec( Spec ), KTable )
74import Rel8.Schema.Spec ( Spec( Spec ), KTable )
73import Rel8.Schema.Structure
75import Rel8.Schema.Structure
74 ( IsStructure, Shape(..), Shape1, Shape2
76 ( IsStructure, Shape(..), Shape1, Shape2
@@ -114,9 +116,9 @@ instance TableHelper Expr where
114 gtoColumns = toExprColumns
116 gtoColumns = toExprColumns
117−instance TableHelper Insertion where
119+instance TableHelper Insert where
118− gfromColumns = fromInsertionColumns
120+ gfromColumns = fromInsertColumns
119− gtoColumns = toInsertionColumns
121+ gtoColumns = toInsertColumns
122instance TableHelper Identity where
124instance TableHelper Identity where
@@ -181,8 +183,8 @@ class HTable (GRep t) => Rel8able t where
181 fromExprColumns :: GRep t (Col Expr) -> t Expr
183 fromExprColumns :: GRep t (Col Expr) -> t Expr
182 toExprColumns :: t Expr -> GRep t (Col Expr)
184 toExprColumns :: t Expr -> GRep t (Col Expr)
184− fromInsertionColumns :: GRep t (Col Insertion) -> t Insertion
186+ fromInsertColumns :: GRep t (Col Insert) -> t Insert
185− toInsertionColumns :: t Insertion -> GRep t (Col Insertion)
187+ toInsertColumns :: t Insert -> GRep t (Col Insert)
187 fromIdentityColumns :: GRep t (Col Identity) -> t Identity
189 fromIdentityColumns :: GRep t (Col Identity) -> t Identity
188 toIdentityColumns :: t Identity -> GRep t (Col Identity)
190 toIdentityColumns :: t Identity -> GRep t (Col Identity)
@@ -220,19 +222,19 @@ class HTable (GRep t) => Rel8able t where
220 ) => t Expr -> GRep t (Col Expr)
222 ) => t Expr -> GRep t (Col Expr)
221 toExprColumns = toGColumns @_ @(Rep (t Structure)) . from
223 toExprColumns = toGColumns @_ @(Rep (t Structure)) . from
223− default fromInsertionColumns ::
225+ default fromInsertColumns ::
224− ( Generic (t Insertion)
226+ ( Generic (t Insert)
225 , GColumns (Rep (t Structure)) ~ GRep t
227 , GColumns (Rep (t Structure)) ~ GRep t
226− , GRel8able Insertion (Rep (t Structure)) (Rep (t Insertion))
228+ , GRel8able Insert (Rep (t Structure)) (Rep (t Insert))
227− ) => GRep t (Col Insertion) -> t Insertion
229+ ) => GRep t (Col Insert) -> t Insert
228− fromInsertionColumns = to . fromGColumns @_ @(Rep (t Structure))
230+ fromInsertColumns = to . fromGColumns @_ @(Rep (t Structure))
230− default toInsertionColumns ::
232+ default toInsertColumns ::
231− ( Generic (t Insertion)
233+ ( Generic (t Insert)
232 , GColumns (Rep (t Structure)) ~ GRep t
234 , GColumns (Rep (t Structure)) ~ GRep t
233− , GRel8able Insertion (Rep (t Structure)) (Rep (t Insertion))
235+ , GRel8able Insert (Rep (t Structure)) (Rep (t Insert))
234− ) => t Insertion -> GRep t (Col Insertion)
236+ ) => t Insert -> GRep t (Col Insert)
235− toInsertionColumns = toGColumns @_ @(Rep (t Structure)) . from
237+ toInsertColumns = toGColumns @_ @(Rep (t Structure)) . from
237 default fromIdentityColumns ::
239 default fromIdentityColumns ::
238 ( Generic (t Identity)
240 ( Generic (t Identity)
@@ -402,9 +404,9 @@ instance
405− ( x ~ Field Insertion '[] necessity db a
407+ ( x ~ Field Insert '[] necessity db a
406 , KnownNecessity necessity
408 , KnownNecessity necessity
407− ) => K1Table label Insertion 'True (Shape1 'Column ('Spec '[] necessity db a)) x
409+ ) => K1Table label Insert 'True (Shape1 'Column ('Spec '[] necessity db a)) x
409 fromK1Columns (HIdentity insert) = case insert of
411 fromK1Columns (HIdentity insert) = case insert of
410 RequiredInsert a -> a
412 RequiredInsert a -> a
@@ -417,9 +419,9 @@ instance
420− ( x ~ Field Insertion (label ': labels) necessity db a
422+ ( x ~ Field Insert (label ': labels) necessity db a
421 , KnownNecessity necessity
423 , KnownNecessity necessity
422− ) => K1Table _label Insertion 'True (Shape1 'Column ('Spec (label ': labels) necessity db a)) x
424+ ) => K1Table _label Insert 'True (Shape1 'Column ('Spec (label ': labels) necessity db a)) x
424 fromK1Columns (HIdentity insert) = case insert of
426 fromK1Columns (HIdentity insert) = case insert of
425 RequiredInsert a -> a
427 RequiredInsert a -> a
@@ -520,11 +522,11 @@ instance
521 ( HTable (K1Columns "Left" structure1)
523 ( HTable (K1Columns "Left" structure1)
522 , HTable (K1Columns "Right" structure2)
524 , HTable (K1Columns "Right" structure2)
523− , K1Table "Left" Insertion (IsStructure structure1) structure1 a
525+ , K1Table "Left" Insert (IsStructure structure1) structure1 a
524− , K1Table "Right" Insertion (IsStructure structure2) structure2 b
526+ , K1Table "Right" Insert (IsStructure structure2) structure2 b
525 , e ~ EitherTable a b
527 , e ~ EitherTable a b
526 , KnownSymbol label
528 , KnownSymbol label
527− ) => K1Table label Insertion 'True (Shape2 'Either structure1 structure2) e
529+ ) => K1Table label Insert 'True (Shape2 'Either structure1 structure2) e
529 fromK1Columns =
531 fromK1Columns =
530 fromColumns2
532 fromColumns2
@@ -615,11 +617,11 @@ instance
618− ( Table Insertion a
620+ ( Table Insert a
619 , K1Columns label structure ~ HLabel label (Columns a)
621 , K1Columns label structure ~ HLabel label (Columns a)
620 , as ~ ListTable a
622 , as ~ ListTable a
621 , KnownSymbol label
623 , KnownSymbol label
622− ) => K1Table label Insertion 'True (Shape1 'List structure) as
624+ ) => K1Table label Insert 'True (Shape1 'List structure) as
624 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
626 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
625 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
627 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
@@ -688,10 +690,10 @@ instance
690 ( HTable (K1Columns "Just" structure)
692 ( HTable (K1Columns "Just" structure)
691− , K1Table "Just" Insertion (IsStructure structure) structure a
693+ , K1Table "Just" Insert (IsStructure structure) structure a
692 , ma ~ MaybeTable a
694 , ma ~ MaybeTable a
693 , KnownSymbol label
695 , KnownSymbol label
694− ) => K1Table label Insertion 'True (Shape1 'Maybe structure) ma
696+ ) => K1Table label Insert 'True (Shape1 'Maybe structure) ma
696 fromK1Columns =
698 fromK1Columns =
697 fromColumns1 (fromK1Columns @"Just" @_ @_ @structure) .
699 fromColumns1 (fromK1Columns @"Just" @_ @_ @structure) .
@@ -766,11 +768,11 @@ instance
769− ( Table Insertion a
771+ ( Table Insert a
770 , K1Columns label structure ~ HLabel label (Columns a)
772 , K1Columns label structure ~ HLabel label (Columns a)
771 , as ~ NonEmptyTable a
773 , as ~ NonEmptyTable a
772 , KnownSymbol label
774 , KnownSymbol label
773− ) => K1Table label Insertion 'True (Shape1 'NonEmpty structure) as
775+ ) => K1Table label Insert 'True (Shape1 'NonEmpty structure) as
775 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
777 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
776 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
778 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
@@ -852,11 +854,11 @@ instance
853 ( HTable (K1Columns "Here" structure1)
855 ( HTable (K1Columns "Here" structure1)
854 , HTable (K1Columns "There" structure2)
856 , HTable (K1Columns "There" structure2)
855− , K1Table "Here" Insertion (IsStructure structure1) structure1 a
857+ , K1Table "Here" Insert (IsStructure structure1) structure1 a
856− , K1Table "There" Insertion (IsStructure structure2) structure2 b
858+ , K1Table "There" Insert (IsStructure structure2) structure2 b
857 , e ~ TheseTable a b
859 , e ~ TheseTable a b
858 , KnownSymbol label
860 , KnownSymbol label
859− ) => K1Table label Insertion 'True (Shape2 'These structure1 structure2) e
861+ ) => K1Table label Insert 'True (Shape2 'These structure1 structure2) e
861 fromK1Columns =
863 fromK1Columns =
862 fromColumns2
864 fromColumns2