// Code generated by sqlc. DO NOT EDIT.
// versions:
//   sqlc v1.23.0
// source: query.sql

package querytest

import (
	"context"
)

const listAuthorsUnion = `-- name: ListAuthorsUnion :many
SELECT name as foo FROM authors
UNION
SELECT first_name as foo FROM people
ORDER BY foo
`

func (q *Queries) ListAuthorsUnion(ctx context.Context) ([]string, error) {
	rows, err := q.db.QueryContext(ctx, listAuthorsUnion)
	if err != nil {
		return nil, err
	}
	defer rows.Close()
	var items []string
	for rows.Next() {
		var foo string
		if err := rows.Scan(&foo); err != nil {
			return nil, err
		}
		items = append(items, foo)
	}
	if err := rows.Close(); err != nil {
		return nil, err
	}
	if err := rows.Err(); err != nil {
		return nil, err
	}
	return items, nil
}
