riveruidriver

package
v0.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package riveruidriver defines the database operations that River UI adds on top of River's core driver. Database-specific implementations keep SQL dialect details out of HTTP endpoints while continuing to use the executor already owned by the caller's River client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver interface {
	GetExecutor(riverExecutor riverdriver.Executor) Executor
}

Driver decorates a River executor with queries used only by River UI.

type Executor

type Executor interface {
	riverdriver.Executor

	// JobCountByAllStatesCapped returns an exact count through Max and Max+1 as
	// a sentinel when additional rows exist.
	JobCountByAllStatesCapped(ctx context.Context, params *JobCountByAllStatesCappedParams) (map[rivertype.JobState]int, error)
	// JobCountEstimate returns inexpensive database estimates where supported.
	// Drivers without an estimate strategy return an empty map.
	JobCountEstimate(ctx context.Context, params *JobCountEstimateParams) (map[rivertype.JobState]JobCountEstimateResult, error)
}

Executor contains River UI's database operations and embeds River's executor so callers retain transaction and core query support through one value.

type JobCountByAllStatesCappedParams

type JobCountByAllStatesCappedParams struct {
	// Max must be positive and less than math.MaxInt32 so callers get the same
	// behavior from every database implementation.
	Max    int
	Schema string
}

type JobCountEstimateParams

type JobCountEstimateParams struct {
	Schema string
	States []rivertype.JobState
}

type JobCountEstimateResult

type JobCountEstimateResult struct {
	Count      int
	ObservedAt *time.Time
}

Source Files

  • river_ui_driver_interface.go

Directories

Path Synopsis
Package riveruidrivertest provides a shared conformance suite for River UI database drivers.
Package riveruidrivertest provides a shared conformance suite for River UI database drivers.
Package riveruipostgres implements River UI's database operations for PostgreSQL.
Package riveruipostgres implements River UI's database operations for PostgreSQL.
Package riveruisqlite implements River UI's database operations for SQLite.
Package riveruisqlite implements River UI's database operations for SQLite.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL