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

package querytest

import (
	"context"
	"net/netip"
)

const generateSeries = `-- name: GenerateSeries :many
SELECT ($1::inet) + i
FROM generate_series(0, $2::int) AS i
LIMIT 1
`

type GenerateSeriesParams struct {
	Column1 netip.Addr
	Column2 int32
}

func (q *Queries) GenerateSeries(ctx context.Context, arg GenerateSeriesParams) ([]int32, error) {
	rows, err := q.db.Query(ctx, generateSeries, arg.Column1, arg.Column2)
	if err != nil {
		return nil, err
	}
	defer rows.Close()
	var items []int32
	for rows.Next() {
		var column_1 int32
		if err := rows.Scan(&column_1); err != nil {
			return nil, err
		}
		items = append(items, column_1)
	}
	if err := rows.Err(); err != nil {
		return nil, err
	}
	return items, nil
}

const getDate = `-- name: GetDate :one
SELECT  from CURRENT_DATE
`

type GetDateRow struct {
}

func (q *Queries) GetDate(ctx context.Context) (GetDateRow, error) {
	row := q.db.QueryRow(ctx, getDate)
	var i GetDateRow
	err := row.Scan()
	return i, err
}

const getUsers = `-- name: GetUsers :many
SELECT id, first_name
FROM users_func()
WHERE first_name != ''
`

func (q *Queries) GetUsers(ctx context.Context) ([]User, error) {
	rows, err := q.db.Query(ctx, getUsers)
	if err != nil {
		return nil, err
	}
	defer rows.Close()
	var items []User
	for rows.Next() {
		var i User
		if err := rows.Scan(&i.ID, &i.FirstName); err != nil {
			return nil, err
		}
		items = append(items, i)
	}
	if err := rows.Err(); err != nil {
		return nil, err
	}
	return items, nil
}
