on master help sign in
Rename Insertion to Create
commite15f3605bb60f38952918931203cea5165c603d5 authorShane O'Brien <shane.obrien@circuithub.com> dateSun 13 Jun 2021, 18:58 (5 years ago) parent63c5e03
5 files changed+23−23
src/Rel8/Column/Field.hs+1−1 src/Rel8/Generic/Construction.hs+1−1 src/Rel8/Schema/Insert.hs+18−18 src/Rel8/Table/Insert.hs+1−1 src/Rel8/Table/Opaleye.hs+2−2
src/Rel8/Column/Field.hs+1−1
@@ -24,7 +24,7 @@ import Rel8.Kind.Necessity
2424 , KnownNecessity, necessitySing
2525 )
2626import Rel8.Schema.HTable.Identity ( HIdentity( HIdentity ) )
27−import Rel8.Schema.Insert ( Insert, Insertion(..), Col( I ) )
27+import Rel8.Schema.Insert ( Col( I ), Create(..), Insert )
2828import qualified Rel8.Schema.Kind as K
2929import Rel8.Schema.Name ( Name(..), Col( N ) )
3030import Rel8.Schema.Null ( Sql )
src/Rel8/Generic/Construction.hs+1−1
@@ -64,7 +64,7 @@ import qualified Rel8.Kind.Algebra as K
6464import Rel8.Schema.Context.Nullify ( runTag )
6565import Rel8.Schema.HTable ( HTable )
6666import Rel8.Schema.HTable.Identity ( HIdentity( HType ) )
67−import Rel8.Schema.Insert ( Col( I ), Insert, Insertion(..) )
67+import Rel8.Schema.Insert ( Col( I ), Create(..), Insert )
6868import qualified Rel8.Schema.Kind as K
6969import Rel8.Schema.Name ( Col( N ), Name( Name ) )
7070import Rel8.Schema.Null ( Nullity( Null, NotNull ) )
src/Rel8/Schema/Insert.hs+18−18
@@ -17,7 +17,7 @@ module Rel8.Schema.Insert
1717 , OnConflict(..)
1818 , Col( I, unI )
1919 , Inserts
20− , Insertion(..)
20+ , Create(..)
2121 )
2222where
2323
@@ -79,20 +79,20 @@ data Insert a where
7979
8080instance Interpretation Insert where
8181 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)
8383
8484
85−type Insertion :: Necessity -> Type -> Type
86−data Insertion necessity a where
87− Default :: Insertion 'Optional a
88− Value :: Expr a -> Insertion necessity a
85+type Create :: Necessity -> Type -> Type
86+data Create necessity a where
87+ Default :: Create 'Optional a
88+ Value :: Expr a -> Create necessity a
8989
9090
9191instance (KnownNecessity necessity, Sql DBType a) =>
92− Table Insert (Insertion necessity a)
92+ Table Insert (Create necessity a)
9393 where
94− type Columns (Insertion necessity a) = HIdentity ('Spec '[] necessity a)
95− type Context (Insertion necessity a) = Insert
94+ type Columns (Create necessity a) = HIdentity ('Spec '[] necessity a)
95+ type Context (Create necessity a) = Insert
9696
9797 toColumns = HIdentity . I
9898 fromColumns (HIdentity (I a)) = a
@@ -101,34 +101,34 @@ instance (KnownNecessity necessity, Sql DBType a) =>
101101
102102
103103instance Sql DBType a =>
104− Recontextualize Aggregate Insert (Aggregate (Expr a)) (Insertion 'Required a)
104+ Recontextualize Aggregate Insert (Aggregate (Expr a)) (Create 'Required a)
105105
106106
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)
108108
109109
110110instance Sql DBType a =>
111− Recontextualize Result Insert (Identity a) (Insertion 'Required a)
111+ Recontextualize Result Insert (Identity a) (Create 'Required a)
112112
113113
114114instance Sql DBType a =>
115− Recontextualize Insert Aggregate (Insertion 'Required a) (Aggregate (Expr a))
115+ Recontextualize Insert Aggregate (Create 'Required a) (Aggregate (Expr a))
116116
117117
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)
119119
120120
121121instance Sql DBType a =>
122− Recontextualize Insert Result (Insertion 'Required a) (Identity a)
122+ Recontextualize Insert Result (Create 'Required a) (Identity a)
123123
124124
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)
126126
127127
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)
129129
130130
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)
132132
133133
134134instance Labelable Insert where
src/Rel8/Table/Insert.hs+1−1
@@ -16,7 +16,7 @@ import Prelude
1616import Rel8.Expr ( Col( E ) )
1717import Rel8.Kind.Necessity ( SNecessity( SOptional, SRequired ) )
1818import Rel8.Schema.HTable ( hfield, htabulate, hspecs )
19−import Rel8.Schema.Insert ( Inserts, Col( I ), Insertion(..) )
19+import Rel8.Schema.Insert ( Inserts, Col( I ), Create(..) )
2020import Rel8.Schema.Spec ( SSpec(..) )
2121import Rel8.Table ( fromColumns, toColumns )
2222
src/Rel8/Table/Opaleye.hs+2−2
@@ -45,8 +45,8 @@ import Rel8.Expr.Opaleye
4545 )
4646import Rel8.Kind.Necessity ( SNecessity( SRequired, SOptional ) )
4747import Rel8.Schema.HTable ( htabulateA, hfield, htraverse, hspecs, htabulate )
48−import Rel8.Schema.Insert ( Insert, Inserts, Col( I ), Insertion(..) )
49−import Rel8.Schema.Name ( Name( Name ), Selects, Col( N ) )
48+import Rel8.Schema.Insert ( Col( I ), Create(..), Insert, Inserts )
49+import Rel8.Schema.Name ( Col( N ), Name( Name ), Selects )
5050import Rel8.Schema.Spec ( SSpec(..) )
5151import Rel8.Schema.Table ( TableSchema(..) )
5252import Rel8.Table ( Table, fromColumns, toColumns )