func (o PollsTownSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {
	ln := int64(len(o))
	if ln == 0 {
		return 0, nil
	}

	if len(cols) == 0 {
		return 0, errors.New("models: update all requires at least one column argument")
	}

	colNames := make([]string, len(cols))
	args := make([]interface{}, len(cols))

	i := 0
	for name, value := range cols {
		colNames[i] = name
		args[i] = value
		i++
	}

	// Append all of the primary key values for each column
	for _, obj := range o {
		pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), pollsTownPrimaryKeyMapping)
		args = append(args, pkeyArgs...)
	}

	sql := fmt.Sprintf("UPDATE \"polls_town\" SET %s WHERE %s",
		strmangle.SetParamNames("\"", "\"", 1, colNames),
		strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), len(colNames)+1, pollsTownPrimaryKeyColumns, len(o)))

	if boil.DebugMode {
		fmt.Fprintln(boil.DebugWriter, sql)
		fmt.Fprintln(boil.DebugWriter, args...)
	}

	result, err := exec.ExecContext(ctx, sql, args...)
	if err != nil {
		return 0, errors.Wrap(err, "models: unable to update all in pollsTown slice")
	}

	rowsAff, err := result.RowsAffected()
	if err != nil {
		return 0, errors.Wrap(err, "models: unable to retrieve rows affected all in update all pollsTown")
	}
	return rowsAff, nil
}
// UpdateAll updates all rows with the specified column values, using an executor.
UpdateAll updates all rows with the specified column values, using an executor.
// UpdateAll updates all rows with the specified column values using an executor .
func (o PollsTownSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {
	ln := int64(len(o))
	if ln == 0 {
		return 0, nil
	}
	if len(cols) == 0 {
		return 0, errors.New("models: update all requires at least one column argument")
	}
	colNames := make([]string, len(cols))
	args := make([]interface{}, len(cols))
	i := 0
	for name, value := range cols {
		colNames[i] = name
		args[i] = value
		i++
	}
	for _, obj := range o {
		pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), pollsTownPrimaryKeyMapping)
		args = append(args, pkeyArgs...)
	}
	sql := fmt.Sprintf("UPDATE \"polls_town\" SET %s WHERE %s",
		strmangle.SetParamNames("\"", "\"", 1, colNames),
		strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), len(colNames)+1, pollsTownPrimaryKeyColumns, len(o)))
	if boil.DebugMode {
		fmt.Fprintln(boil.DebugWriter, sql)
		fmt.Fprintln(boil.DebugWriter, args...)
	}
	result, err := exec.ExecContext(ctx, sql, args...)
	if err != nil {
		return 0, errors.Wrap(err, "models: unable to update all in pollsTown slice")
	}
	rowsAff, err := result.RowsAffected()
	if err != nil {
		return 0, errors.Wrap(err, "models: unable to retrieve rows affected all in update all pollsTown")
	}
	return rowsAff, nil
}
func ( o PollsTownSlice ) UpdateAll ( ctx context . Context , exec boil . ContextExecutor , cols M ) ( int64 , error ) { ln := int64 ( len ( o ) ) if ln == 0 { return 0 , nil } if len ( cols ) == 0 { return 0 , errors . New ( " " ) } colNames := make ( [ ] string , len ( cols ) ) args := make ( [ ] interface { } , len ( cols ) ) i := 0 for name , value := range cols { colNames [ i ] = name args [ i ] = value i ++ } for _ , obj := range o { pkeyArgs := queries . ValuesFromMapping ( reflect . Indirect ( reflect . ValueOf ( obj ) ) , pollsTownPrimaryKeyMapping ) args = append ( args , pkeyArgs ... ) } sql := fmt . Sprintf ( " \" \" " , strmangle . SetParamNames ( " \" " , " \" " , 1 , colNames ) , strmangle . WhereClauseRepeated ( string ( dialect . LQ ) , string ( dialect . RQ ) , len ( colNames ) + 1 , pollsTownPrimaryKeyColumns , len ( o ) ) ) if boil . DebugMode { fmt . Fprintln ( boil . DebugWriter , sql ) fmt . Fprintln ( boil . DebugWriter , args ... ) } result , err := exec . ExecContext ( ctx , sql , args ... ) if err != nil { return 0 , errors . Wrap ( err , " " ) } rowsAff , err := result . RowsAffected ( ) if err != nil { return 0 , errors . Wrap ( err , " " ) } return rowsAff , nil }
UpdateAll updates all rows with the specified column values, using an executor.
UpdateAll updates all rows with the specified column values using an executor .
// Append all of the primary key values for each column