File tree Expand file tree Collapse file tree 1 file changed +64
-0
lines changed Expand file tree Collapse file tree 1 file changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ package database
2+
3+ type InsertStatement interface {
4+ Into (table string ) InsertStatement
5+
6+ SetColumns (columns ... string ) InsertStatement
7+
8+ SetExcludedColumns (columns ... string ) InsertStatement
9+
10+ Entity () Entity
11+
12+ Table () string
13+
14+ Columns () []string
15+
16+ ExcludedColumns () []string
17+ }
18+
19+ func NewInsert (entity Entity ) InsertStatement {
20+ return & insertStatement {
21+ entity : entity ,
22+ }
23+ }
24+
25+ type insertStatement struct {
26+ entity Entity
27+ table string
28+ columns []string
29+ excludedColumns []string
30+ }
31+
32+ func (i * insertStatement ) Into (table string ) InsertStatement {
33+ i .table = table
34+
35+ return i
36+ }
37+
38+ func (i * insertStatement ) SetColumns (columns ... string ) InsertStatement {
39+ i .columns = columns
40+
41+ return i
42+ }
43+
44+ func (i * insertStatement ) SetExcludedColumns (columns ... string ) InsertStatement {
45+ i .excludedColumns = columns
46+
47+ return i
48+ }
49+
50+ func (i * insertStatement ) Entity () Entity {
51+ return i .entity
52+ }
53+
54+ func (i * insertStatement ) Table () string {
55+ return i .table
56+ }
57+
58+ func (i * insertStatement ) Columns () []string {
59+ return i .columns
60+ }
61+
62+ func (i * insertStatement ) ExcludedColumns () []string {
63+ return i .excludedColumns
64+ }
You can’t perform that action at this time.
0 commit comments