func (o *Emoji) SetPositions(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Position) error {
	query := "update \"positions\" set \"emoji_id\" = null where \"emoji_id\" = $1"
	values := []interface{}{o.EmojiID}
	if boil.DebugMode {
		fmt.Fprintln(boil.DebugWriter, query)
		fmt.Fprintln(boil.DebugWriter, values)
	}

	_, err := exec.ExecContext(ctx, query, values...)
	if err != nil {
		return errors.Wrap(err, "failed to remove relationships before set")
	}

	if o.R != nil {
		for _, rel := range o.R.Positions {
			queries.SetScanner(&rel.EmojiID, nil)
			if rel.R == nil {
				continue
			}

			rel.R.Emoji = nil
		}

		o.R.Positions = nil
	}
	return o.AddPositions(ctx, exec, insert, related...)
}
// SetPositions removes all previously related items of the
// emoji replacing them completely with the passed
// in related items, optionally inserting them as new records.
// Sets o.R.Emoji's Positions accordingly.
// Replaces o.R.Positions with related.
// Sets related.R.Emoji's Positions accordingly.
SetPositions removes all previously related items of the
emoji replacing them completely with the passed
in related items, optionally inserting them as new records.
Sets o.R.Emoji's Positions accordingly.
Replaces o.R.Positions with related.
Sets related.R.Emoji's Positions accordingly.
// SetPositions removes all previously related items of the // emoji replacing them completely with the passed // in related items optionally inserting them as new records . // Sets o . R . Emoji ' s Positions accordingly . // Replaces o . R . Positions with related . // Sets related . R . Emoji ' s Positions accordingly .
func (o *Emoji) SetPositions(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Position) error {
	query := "update \"positions\" set \"emoji_id\" = null where \"emoji_id\" = $1"
	values := []interface{}{o.EmojiID}
	if boil.DebugMode {
		fmt.Fprintln(boil.DebugWriter, query)
		fmt.Fprintln(boil.DebugWriter, values)
	}
	_, err := exec.ExecContext(ctx, query, values...)
	if err != nil {
		return errors.Wrap(err, "failed to remove relationships before set")
	}
	if o.R != nil {
		for _, rel := range o.R.Positions {
			queries.SetScanner(&rel.EmojiID, nil)
			if rel.R == nil {
				continue
			}
			rel.R.Emoji = nil
		}
		o.R.Positions = nil
	}
	return o.AddPositions(ctx, exec, insert, related...)
}
func ( o * Emoji ) SetPositions ( ctx context . Context , exec boil . ContextExecutor , insert bool , related ... * Position ) error { query := " \" \" \" \" \" \" " values := [ ] interface { } { o . EmojiID } if boil . DebugMode { fmt . Fprintln ( boil . DebugWriter , query ) fmt . Fprintln ( boil . DebugWriter , values ) } _ , err := exec . ExecContext ( ctx , query , values ... ) if err != nil { return errors . Wrap ( err , " " ) } if o . R != nil { for _ , rel := range o . R . Positions { queries . SetScanner ( & rel . EmojiID , nil ) if rel . R == nil { continue } rel . R . Emoji = nil } o . R . Positions = nil } return o . AddPositions ( ctx , exec , insert , related ... ) }
SetPositions removes all previously related items of the
emoji replacing them completely with the passed
in related items, optionally inserting them as new records.
SetPositions removes all previously related items of the emoji replacing them completely with the passed in related items optionally inserting them as new records .