3
0
corteza/pkg/rh/updaters.go
2019-10-29 10:06:14 +01:00

17 lines
368 B
Go

package rh
import (
"github.com/Masterminds/squirrel"
"github.com/titpetric/factory"
)
type (
Set map[string]interface{}
)
// UpdateColumns constructs and executes an update query
func UpdateColumns(db *factory.DB, table string, set Set, cnd squirrel.Sqlizer) error {
_, err := squirrel.ExecWith(db, squirrel.Update(table).SetMap(set).Where(cnd))
return err
}