on master help sign in
Rename Insertion to Create
e15f360Shane O'Brien
src/Rel8/Column/Field.hs+1−1
@@ -24,7 +24,7 @@ import Rel8.Kind.Necessity
24 , KnownNecessity, necessitySing
24 , KnownNecessity, necessitySing
25 )
25 )
26import Rel8.Schema.HTable.Identity ( HIdentity( HIdentity ) )
26import Rel8.Schema.HTable.Identity ( HIdentity( HIdentity ) )
27−import Rel8.Schema.Insert ( Insert, Insertion(..), Col( I ) )
27+import Rel8.Schema.Insert ( Col( I ), Create(..), Insert )
28import qualified Rel8.Schema.Kind as K
28import qualified Rel8.Schema.Kind as K
29import Rel8.Schema.Name ( Name(..), Col( N ) )
29import Rel8.Schema.Name ( Name(..), Col( N ) )
30import Rel8.Schema.Null ( Sql )
30import Rel8.Schema.Null ( Sql )
src/Rel8/Generic/Construction.hs+1−1
@@ -64,7 +64,7 @@ import qualified Rel8.Kind.Algebra as K
64import Rel8.Schema.Context.Nullify ( runTag )
64import Rel8.Schema.Context.Nullify ( runTag )
65import Rel8.Schema.HTable ( HTable )
65import Rel8.Schema.HTable ( HTable )
66import Rel8.Schema.HTable.Identity ( HIdentity( HType ) )
66import Rel8.Schema.HTable.Identity ( HIdentity( HType ) )
67−import Rel8.Schema.Insert ( Col( I ), Insert, Insertion(..) )
67+import Rel8.Schema.Insert ( Col( I ), Create(..), Insert )
68import qualified Rel8.Schema.Kind as K
68import qualified Rel8.Schema.Kind as K
69import Rel8.Schema.Name ( Col( N ), Name( Name ) )
69import Rel8.Schema.Name ( Col( N ), Name( Name ) )
70import Rel8.Schema.Null ( Nullity( Null, NotNull ) )
70import Rel8.Schema.Null ( Nullity( Null, NotNull ) )
src/Rel8/Schema/Insert.hs+18−18
@@ -17,7 +17,7 @@ module Rel8.Schema.Insert
17 , OnConflict(..)
17 , OnConflict(..)
18 , Col( I, unI )
18 , Col( I, unI )
19 , Inserts
19 , Inserts
20− , Insertion(..)
20+ , Create(..)
21 )
21 )
22where
22where
23
23
@@ -79,20 +79,20 @@ data Insert a where
79
79
80instance Interpretation Insert where
80instance Interpretation Insert where
81 data Col Insert _spec where
81 data Col Insert _spec where
82− I :: {unI :: !(Insertion necessity a)} -> Col Insert ('Spec labels necessity a)
82+ I :: {unI :: !(Create necessity a)} -> Col Insert ('Spec labels necessity a)
83
83
84
84
85−type Insertion :: Necessity -> Type -> Type
85+type Create :: Necessity -> Type -> Type
86−data Insertion necessity a where
86+data Create necessity a where
87− Default :: Insertion 'Optional a
87+ Default :: Create 'Optional a
88− Value :: Expr a -> Insertion necessity a
88+ Value :: Expr a -> Create necessity a
89
89
90
90
91instance (KnownNecessity necessity, Sql DBType a) =>
91instance (KnownNecessity necessity, Sql DBType a) =>
92− Table Insert (Insertion necessity a)
92+ Table Insert (Create necessity a)
93 where
93 where
94− type Columns (Insertion necessity a) = HIdentity ('Spec '[] necessity a)
94+ type Columns (Create necessity a) = HIdentity ('Spec '[] necessity a)
95− type Context (Insertion necessity a) = Insert
95+ type Context (Create necessity a) = Insert
96
96
97 toColumns = HIdentity . I
97 toColumns = HIdentity . I
98 fromColumns (HIdentity (I a)) = a
98 fromColumns (HIdentity (I a)) = a
@@ -101,34 +101,34 @@ instance (KnownNecessity necessity, Sql DBType a) =>
101
101
102
102
103instance Sql DBType a =>
103instance Sql DBType a =>
104− Recontextualize Aggregate Insert (Aggregate (Expr a)) (Insertion 'Required a)
104+ Recontextualize Aggregate Insert (Aggregate (Expr a)) (Create 'Required a)
105
105
106
106
107−instance Sql DBType a => Recontextualize Expr Insert (Expr a) (Insertion 'Required a)
107+instance Sql DBType a => Recontextualize Expr Insert (Expr a) (Create 'Required a)
108
108
109
109
110instance Sql DBType a =>
110instance Sql DBType a =>
111− Recontextualize Result Insert (Identity a) (Insertion 'Required a)
111+ Recontextualize Result Insert (Identity a) (Create 'Required a)
112
112
113
113
114instance Sql DBType a =>
114instance Sql DBType a =>
115− Recontextualize Insert Aggregate (Insertion 'Required a) (Aggregate (Expr a))
115+ Recontextualize Insert Aggregate (Create 'Required a) (Aggregate (Expr a))
116
116
117
117
118−instance Sql DBType a => Recontextualize Insert Expr (Insertion 'Required a) (Expr a)
118+instance Sql DBType a => Recontextualize Insert Expr (Create 'Required a) (Expr a)
119
119
120
120
121instance Sql DBType a =>
121instance Sql DBType a =>
122− Recontextualize Insert Result (Insertion 'Required a) (Identity a)
122+ Recontextualize Insert Result (Create 'Required a) (Identity a)
123
123
124
124
125−instance Sql DBType a => Recontextualize Insert Insert (Insertion 'Required a) (Insertion 'Required a)
125+instance Sql DBType a => Recontextualize Insert Insert (Create 'Required a) (Create 'Required a)
126
126
127
127
128−instance Sql DBType a => Recontextualize Insert Name (Insertion 'Required a) (Name a)
128+instance Sql DBType a => Recontextualize Insert Name (Create 'Required a) (Name a)
129
129
130
130
131−instance Sql DBType a => Recontextualize Name Insert (Name a) (Insertion 'Required a)
131+instance Sql DBType a => Recontextualize Name Insert (Name a) (Create 'Required a)
132
132
133
133
134instance Labelable Insert where
134instance Labelable Insert where
src/Rel8/Table/Insert.hs+1−1
@@ -16,7 +16,7 @@ import Prelude
16import Rel8.Expr ( Col( E ) )
16import Rel8.Expr ( Col( E ) )
17import Rel8.Kind.Necessity ( SNecessity( SOptional, SRequired ) )
17import Rel8.Kind.Necessity ( SNecessity( SOptional, SRequired ) )
18import Rel8.Schema.HTable ( hfield, htabulate, hspecs )
18import Rel8.Schema.HTable ( hfield, htabulate, hspecs )
19−import Rel8.Schema.Insert ( Inserts, Col( I ), Insertion(..) )
19+import Rel8.Schema.Insert ( Inserts, Col( I ), Create(..) )
20import Rel8.Schema.Spec ( SSpec(..) )
20import Rel8.Schema.Spec ( SSpec(..) )
21import Rel8.Table ( fromColumns, toColumns )
21import Rel8.Table ( fromColumns, toColumns )
22
22
src/Rel8/Table/Opaleye.hs+2−2
@@ -45,8 +45,8 @@ import Rel8.Expr.Opaleye
45 )
45 )
46import Rel8.Kind.Necessity ( SNecessity( SRequired, SOptional ) )
46import Rel8.Kind.Necessity ( SNecessity( SRequired, SOptional ) )
47import Rel8.Schema.HTable ( htabulateA, hfield, htraverse, hspecs, htabulate )
47import Rel8.Schema.HTable ( htabulateA, hfield, htraverse, hspecs, htabulate )
48−import Rel8.Schema.Insert ( Insert, Inserts, Col( I ), Insertion(..) )
48+import Rel8.Schema.Insert ( Col( I ), Create(..), Insert, Inserts )
49−import Rel8.Schema.Name ( Name( Name ), Selects, Col( N ) )
49+import Rel8.Schema.Name ( Col( N ), Name( Name ), Selects )
50import Rel8.Schema.Spec ( SSpec(..) )
50import Rel8.Schema.Spec ( SSpec(..) )
51import Rel8.Schema.Table ( TableSchema(..) )
51import Rel8.Schema.Table ( TableSchema(..) )
52import Rel8.Table ( Table, fromColumns, toColumns )
52import Rel8.Table ( Table, fromColumns, toColumns )