func RevisionFuzzingTimedelta(delta time.Duration) Option {
	return func(po *postgresOptions) {
		po.revisionFuzzingTimedelta = delta
	}
}
RevisionFuzzingTimedelta is the time bucket size to which advertised
revisions will be rounded.

This value defaults to 5 seconds.
package postgres
import (
	"fmt"
	"time"
	"github.com/alecthomas/units"
	"github.com/authzed/spicedb/internal/datastore/common"
)
type postgresOptions struct {
	connMaxIdleTime   *time.Duration
	connMaxLifetime   *time.Duration
	healthCheckPeriod *time.Duration
	maxOpenConns      *int
	minOpenConns      *int
	watchBufferLength         uint16
	revisionFuzzingTimedelta  time.Duration
	gcWindow                  time.Duration
	gcInterval                time.Duration
	gcMaxOperationTime        time.Duration
	splitAtEstimatedQuerySize units.Base2Bytes
	enablePrometheusStats bool
	logger *tracingLogger
}
const (
	errFuzzingTooLarge = "revision fuzzing timedelta (%s) must be less than GC window (%s)"
	defaultWatchBufferLength                 = 128
	defaultGarbageCollectionWindow           = 24 * time.Hour
	defaultGarbageCollectionInterval         = time.Minute * 3
	defaultGarbageCollectionMaxOperationTime = time.Minute
)
type Option func(*postgresOptions)
func generateConfig(options []Option) (postgresOptions, error) {
	computed := postgresOptions{
		gcWindow:                  defaultGarbageCollectionWindow,
		gcInterval:                defaultGarbageCollectionInterval,
		gcMaxOperationTime:        defaultGarbageCollectionMaxOperationTime,
		watchBufferLength:         defaultWatchBufferLength,
		splitAtEstimatedQuerySize: common.DefaultSplitAtEstimatedQuerySize,
	}
	for _, option := range options {
		option(&computed)
	}
	if computed.revisionFuzzingTimedelta >= computed.gcWindow {
		return computed, fmt.Errorf(
			errFuzzingTooLarge,
			computed.revisionFuzzingTimedelta,
			computed.gcWindow,
		)
	}
	return computed, nil
}
func SplitAtEstimatedQuerySize(splitAtEstimatedQuerySize units.Base2Bytes) Option {
	return func(po *postgresOptions) {
		po.splitAtEstimatedQuerySize = splitAtEstimatedQuerySize
	}
}
func ConnMaxIdleTime(idle time.Duration) Option {
	return func(po *postgresOptions) {
		po.connMaxIdleTime = &idle
	}
}
func ConnMaxLifetime(lifetime time.Duration) Option {
	return func(po *postgresOptions) {
		po.connMaxLifetime = &lifetime
	}
}
func HealthCheckPeriod(period time.Duration) Option {
	return func(po *postgresOptions) {
		po.healthCheckPeriod = &period
	}
}
func MaxOpenConns(conns int) Option {
	return func(po *postgresOptions) {
		po.maxOpenConns = &conns
	}
}
func MinOpenConns(conns int) Option {
	return func(po *postgresOptions) {
		po.minOpenConns = &conns
	}
}
func WatchBufferLength(watchBufferLength uint16) Option {
	return func(po *postgresOptions) {
		po.watchBufferLength = watchBufferLength
	}
}