func ArrayAppend(name string, value interface{}) UpdateFunction {
	return UpdateFunction{
		Name:      "array_append",
		Arguments: []interface{}{Indirect(name), value},
	}
}
ArrayAppend is an UpdateFunction for calling PostgreSQL's
array_append function during an update.
package sqlz
import (
	"context"
	"database/sql"
	"fmt"
	"strings"
	"github.com/jmoiron/sqlx"
)
type UpdateStmt struct {
	*Statement
	Table           string
	Updates         map[string]interface{}
	Conditions      []WhereCondition
	Return          []string
	execer          Ext
	SelectStmt      *SelectStmt
	SelectStmtAlias string
}
func (db *DB) Update(table string) *UpdateStmt {
	return &UpdateStmt{
		Table:     table,
		Updates:   make(map[string]interface{}),
		execer:    db.DB,
		Statement: &Statement{db.ErrHandlers},
	}
}
func (tx *Tx) Update(table string) *UpdateStmt {
	return &UpdateStmt{
		Table:     table,
		Updates:   make(map[string]interface{}),
		execer:    tx.Tx,
		Statement: &Statement{tx.ErrHandlers},
	}
}
func (stmt *UpdateStmt) Set(col string, value interface{}) *UpdateStmt {
	return stmt.SetIf(col, value, true)
}
func (stmt *UpdateStmt) SetMap(updates map[string]interface{}) *UpdateStmt {
	for col, value := range updates {
		stmt.Updates[col] = value
	}
	return stmt
}
func (stmt *UpdateStmt) SetIf(col string, value interface{}, b bool) *UpdateStmt {
	if b {
		stmt.Updates[col] = value
	}
	return stmt
}
func (stmt *UpdateStmt) Where(conditions ...WhereCondition) *UpdateStmt {
	stmt.Conditions = append(stmt.Conditions, conditions...)
	return stmt
}
func (stmt *UpdateStmt) Returning(cols ...string) *UpdateStmt {
	stmt.Return = append(stmt.Return, cols...)
	return stmt
}
func (stmt *UpdateStmt) FromSelect(selStmt *SelectStmt, alias string) *UpdateStmt {
	stmt.SelectStmt = selStmt
	stmt.SelectStmtAlias = alias
	return stmt
}
func (stmt *UpdateStmt) ToSQL(rebind bool) (asSQL string, bindings []interface{}) {
	var clauses = []string{fmt.Sprintf("UPDATE %s", stmt.Table)}
	var updates []string
	for _, col := range sortKeys(stmt.Updates) {
		val := stmt.Updates[col]
		if fn, isFn := val.(UpdateFunction); isFn {
			var args []string
			for _, arg := range fn.Arguments {
				if indirect, isIndirect := arg.(IndirectValue); isIndirect {
					args = append(args, indirect.Reference)
					bindings = append(bindings, indirect.Bindings...)
				} else {
					args = append(args, "?")
					bindings = append(bindings, arg)
				}
			}
			updates = append(updates, col+" = "+fn.Name+"("+strings.Join(args, ", ")+")")
		} else if indirect, isIndirect := val.(IndirectValue); isIndirect {
			updates = append(updates, col+" = "+indirect.Reference)
			bindings = append(bindings, indirect.Bindings...)
		} else {
			updates = append(updates, col+" = ?")
			bindings = append(bindings, val)
		}
	}
	clauses = append(clauses, "SET "+strings.Join(updates, ", "))
	if stmt.SelectStmt != nil && stmt.SelectStmtAlias != "" {
		selectSQL, selectBindings := stmt.SelectStmt.ToSQL(false)
		selectSQL = "(" + selectSQL + ") AS " + stmt.SelectStmtAlias + " "
		clauses = append(clauses, "FROM ")
		clauses = append(clauses, selectSQL)
		bindings = append(bindings, selectBindings...)
	}
	if len(stmt.Conditions) > 0 {
		whereClause, whereBindings := parseConditions(stmt.Conditions)
		bindings = append(bindings, whereBindings...)
		clauses = append(clauses, fmt.Sprintf("WHERE %s", whereClause))
	}
	if len(stmt.Return) > 0 {
		clauses = append(clauses, "RETURNING "+strings.Join(stmt.Return, ", "))
	}
	asSQL = strings.Join(clauses, " ")
	if rebind {
		if db, ok := stmt.execer.(*sqlx.DB); ok {
			asSQL = db.Rebind(asSQL)
		} else if tx, ok := stmt.execer.(*sqlx.Tx); ok {
			asSQL = tx.Rebind(asSQL)
		}
	}
	return asSQL, bindings
}
func (stmt *UpdateStmt) Exec() (res sql.Result, err error) {
	asSQL, bindings := stmt.ToSQL(true)
	res, err = stmt.execer.Exec(asSQL, bindings...)
	stmt.HandleError(err)
	return res, err
}
func (stmt *UpdateStmt) ExecContext(ctx context.Context) (res sql.Result, err error) {
	asSQL, bindings := stmt.ToSQL(true)
	res, err = stmt.execer.ExecContext(ctx, asSQL, bindings...)
	stmt.HandleError(err)
	return res, err
}
func (stmt *UpdateStmt) GetRow(into interface{}) error {
	asSQL, bindings := stmt.ToSQL(true)
	err := sqlx.Get(stmt.execer, into, asSQL, bindings...)
	stmt.HandleError(err)
	return err
}
func (stmt *UpdateStmt) GetRowContext(ctx context.Context, into interface{}) error {
	asSQL, bindings := stmt.ToSQL(true)
	err := sqlx.GetContext(ctx, stmt.execer, into, asSQL, bindings...)
	stmt.HandleError(err)
	return err
}
func (stmt *UpdateStmt) GetAll(into interface{}) error {
	asSQL, bindings := stmt.ToSQL(true)
	err := sqlx.Select(stmt.execer, into, asSQL, bindings...)
	stmt.HandleError(err)
	return err
}
func (stmt *UpdateStmt) GetAllContext(ctx context.Context, into interface{}) error {
	asSQL, bindings := stmt.ToSQL(true)
	err := sqlx.SelectContext(ctx, stmt.execer, into, asSQL, bindings...)
	stmt.HandleError(err)
	return err
}
type UpdateFunction struct {
	Name      string
	Arguments []interface{}
}