<commit_before>package dbr

type union struct {
	builder []Builder
	all     bool
}

func Union(builder ...Builder) interface {
	Builder
	As(string) Builder
} {
	return &union{
		builder: builder,
	}
}

func UnionAll(builder ...Builder) interface {
	Builder
	As(string) Builder
} {
	return &union{
		builder: builder,
		all:     true,
	}
}

func (u *union) Build(d Dialect, buf Buffer) error {
	for i, b := range u.builder {
		if i > 0 {
			buf.WriteString(" UNION ")
			if u.all {
				buf.WriteString("ALL ")
			}
		}
		buf.WriteString(placeholder)
		buf.WriteValue(b)
	}
	return nil
}

func (u *union) As(alias string) Builder {
	return as(u, alias)
}
<commit_msg>Make union useable<commit_after>package dbr

type union struct {
	builder []SelectBuilder
	all     bool
}

func Union(builder ...SelectBuilder) interface {
	Builder
	As(string) Builder
} {
	return &union{
		builder: builder,
	}
}

func UnionAll(builder ...SelectBuilder) interface {
	Builder
	As(string) Builder
} {
	return &union{
		builder: builder,
		all:     true,
	}
}

func (u *union) Build(d Dialect, buf Buffer) error {
	for i, b := range u.builder {
		if i > 0 {
			buf.WriteString(" UNION ")
			if u.all {
				buf.WriteString("ALL ")
			}
		}
		buf.WriteString(placeholder)
		buf.WriteValue(b)
	}
	return nil
}

func (u *union) As(alias string) Builder {
	return as(u, alias)
}

{'fraction_non_alphanumeric': 0.1286031042128603, 'fraction_numerical': 0.0014781966001478197, 'mean_word_length': 3.218068535825545, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6752114', 'n_tokens_mistral': 529, 'n_tokens_neox': 494, 'n_words': 136}