restructuring of files. added 2 new methods(Asc, Desc) to field

This commit is contained in:
2025-10-18 12:31:46 +05:30
parent 6f5748d3d3
commit 325103e8ef
13 changed files with 433 additions and 446 deletions

View File

@@ -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()