add update statement

This commit is contained in:
2026-07-07 22:07:50 +01:00
parent 87517d247a
commit f2ebd5b53f
5 changed files with 209 additions and 4 deletions
+9 -4
View File
@@ -30,6 +30,10 @@ func (q *SelectQuery) Args() []any {
}
func (q *SelectQuery) Columns(defs ...string) *SelectQuery {
if q.columns == nil {
q.columns = []Column{}
}
for _, def := range defs {
q.columns = append(q.columns, Column(def))
}
@@ -157,6 +161,10 @@ func (q *SelectQuery) String() string {
}
func (q *SelectQuery) Where(def string, args ...any) *SelectQuery {
if q.where == nil {
q.where = []Where{}
}
q.where = append(q.where, Where(def))
if len(args) > 0 {
@@ -172,10 +180,7 @@ func (q *SelectQuery) Where(def string, args ...any) *SelectQuery {
func Select(from string) *SelectQuery {
q := &SelectQuery{
columns: []Column{},
tables: []SelectTable{From(from)},
where: []Where{},
tables: []SelectTable{From(from)},
}
return q