restructuring of files. added 2 new methods(Asc, Desc) to field
This commit is contained in:
@@ -11,23 +11,30 @@ import (
|
||||
"github.com/jackc/pgx/v5"
|
||||
)
|
||||
|
||||
type updateQry struct {
|
||||
table string
|
||||
cols []string
|
||||
condition []Conditioner
|
||||
args []any
|
||||
debug bool
|
||||
}
|
||||
|
||||
func (t *Table) Update() Update {
|
||||
qb := &updateQry{
|
||||
table: t.Name,
|
||||
debug: t.debug,
|
||||
cols: make([]string, 0, t.FieldCount),
|
||||
args: make([]any, 0, t.FieldCount),
|
||||
type (
|
||||
Update interface {
|
||||
Set(field Field, val any) UpdateClause
|
||||
SetMap(fields map[Field]any) UpdateClause
|
||||
}
|
||||
return qb
|
||||
}
|
||||
|
||||
UpdateClause interface {
|
||||
Update
|
||||
Where(cond ...Conditioner) WhereOrExec
|
||||
}
|
||||
|
||||
WhereOrExec interface {
|
||||
Where(cond ...Conditioner) WhereOrExec
|
||||
Execute
|
||||
}
|
||||
|
||||
updateQry struct {
|
||||
table string
|
||||
cols []string
|
||||
condition []Conditioner
|
||||
args []any
|
||||
debug bool
|
||||
}
|
||||
)
|
||||
|
||||
func (q *updateQry) Set(field Field, val any) UpdateClause {
|
||||
col := field.Name()
|
||||
|
||||
Reference in New Issue
Block a user