File tree Expand file tree Collapse file tree 1 file changed +79
-0
lines changed Expand file tree Collapse file tree 1 file changed +79
-0
lines changed Original file line number Diff line number Diff line change @@ -62,3 +62,82 @@ func (i *insertStatement) Columns() []string {
6262func (i * insertStatement ) ExcludedColumns () []string {
6363 return i .excludedColumns
6464}
65+
66+ type SelectStatement interface {
67+ From (table string ) SelectStatement
68+
69+ SetColumns (columns ... string ) SelectStatement
70+
71+ SetExcludedColumns (columns ... string ) SelectStatement
72+
73+ SetWhere (where string ) SelectStatement
74+
75+ Entity () Entity
76+
77+ Table () string
78+
79+ Columns () []string
80+
81+ ExcludeColumns () []string
82+
83+ Where () string
84+ }
85+
86+ func NewSelect (entity Entity ) SelectStatement {
87+ return & selectStatement {
88+ entity : entity ,
89+ }
90+ }
91+
92+ type selectStatement struct {
93+ entity Entity
94+ table string
95+ columns []string
96+ excludedColumns []string
97+ where string
98+ whereValues []any
99+ }
100+
101+ func (s * selectStatement ) From (table string ) SelectStatement {
102+ s .table = table
103+
104+ return s
105+ }
106+
107+ func (s * selectStatement ) SetColumns (columns ... string ) SelectStatement {
108+ s .columns = columns
109+
110+ return s
111+ }
112+
113+ func (s * selectStatement ) SetExcludedColumns (columns ... string ) SelectStatement {
114+ s .excludedColumns = columns
115+
116+ return s
117+ }
118+
119+ func (s * selectStatement ) SetWhere (where string ) SelectStatement {
120+ s .where = where
121+
122+ return s
123+ }
124+
125+ func (s * selectStatement ) Entity () Entity {
126+ return s .entity
127+ }
128+
129+ func (s * selectStatement ) Table () string {
130+ return s .table
131+ }
132+
133+ func (s * selectStatement ) Columns () []string {
134+ return s .columns
135+ }
136+
137+ func (s * selectStatement ) ExcludeColumns () []string {
138+ return s .excludedColumns
139+ }
140+
141+ func (s * selectStatement ) Where () string {
142+ return s .where
143+ }
You can’t perform that action at this time.
0 commit comments