// Code generated by FTL. DO NOT EDIT.
package db

import (
	"context"
	"github.com/alecthomas/types/tuple"
	"github.com/block/ftl/common/reflection"
	"github.com/block/ftl/go-runtime/ftl"
	"github.com/block/ftl/go-runtime/server"
	stdtime "time"
)

type FindByDataAndIdsQuery struct {
	TextFields []string
	_2s        []int
}
type RequestRow struct {
	Id        int
	Data      ftl.Option[string]
	CreatedAt stdtime.Time
}

type CreateRequestClient func(context.Context, ftl.Option[string]) error

type FindByDataAndIdsClient func(context.Context, FindByDataAndIdsQuery) ([]RequestRow, error)

type FindMultipleClient func(context.Context, []string) ([]RequestRow, error)

type GetRequestDataClient func(context.Context) ([]ftl.Option[string], error)

func init() {
	reflection.Register(
		server.QuerySink[ftl.Option[string]]("postgres", "createRequest", reflection.CommandTypeExec, "testdb", "postgres", "INSERT INTO requests (data) VALUES ($1)", []string{}, []tuple.Pair[string, string]{}),
		server.Query[FindByDataAndIdsQuery, RequestRow]("postgres", "findByDataAndIds", reflection.CommandTypeMany, "testdb", "postgres", "SELECT id, data, created_at FROM requests WHERE data = ANY($1::text[]) AND id = ANY($2::int[])", []string{}, []tuple.Pair[string, string]{tuple.PairOf("id", "Id"), tuple.PairOf("data", "Data"), tuple.PairOf("created_at", "CreatedAt")}),
		server.Query[[]string, RequestRow]("postgres", "findMultiple", reflection.CommandTypeMany, "testdb", "postgres", "SELECT id, data, created_at FROM requests WHERE data = ANY($1::text[])", []string{}, []tuple.Pair[string, string]{tuple.PairOf("id", "Id"), tuple.PairOf("data", "Data"), tuple.PairOf("created_at", "CreatedAt")}),
		server.QuerySource[ftl.Option[string]]("postgres", "getRequestData", reflection.CommandTypeMany, "testdb", "postgres", "SELECT data FROM requests", []string{}, []tuple.Pair[string, string]{}),
	)
}
