queries

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AmendRunParams

type AmendRunParams struct {
	Summary string
	Result  string
	ID      int64
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type FinishRunParams

type FinishRunParams struct {
	Status     string
	ExitCode   *int64
	Summary    string
	Result     string
	LogBytes   int64
	FinishedAt *time.Time
	ID         int64
}

type InsertRunParams

type InsertRunParams struct {
	Kind      string
	Title     string
	Source    string
	RepoOwner string
	RepoName  string
	Dir       string
	Argv      string
	Command   string
	RunsIn    string
	Status    string
	Result    string
	StartedAt time.Time
}

type MarkRunSeenParams

type MarkRunSeenParams struct {
	SeenAt *time.Time
	ID     int64
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) AmendRun

func (q *Queries) AmendRun(ctx context.Context, arg AmendRunParams) (int64, error)

AmendRun rewrites the summary and the result of a run that has finished, as a release does while it follows its workflow on GitHub. A run still going is left as it is.

func (*Queries) DeleteRuns

func (q *Queries) DeleteRuns(ctx context.Context, ids []int64) error

DeleteRuns deletes the runs named that have finished; one still going is kept.

func (*Queries) EndedRunsOfKind

func (q *Queries) EndedRunsOfKind(ctx context.Context, kind string) ([]ScriptRun, error)

EndedRunsOfKind returns the runs of a kind that have finished, oldest first.

func (*Queries) FinishRun

func (q *Queries) FinishRun(ctx context.Context, arg FinishRunParams) (int64, error)

FinishRun records how a run that has not finished ended. A run finished already is left as it is.

func (*Queries) GetRun

func (q *Queries) GetRun(ctx context.Context, id int64) (ScriptRun, error)

GetRun returns one run.

func (*Queries) InsertRun

func (q *Queries) InsertRun(ctx context.Context, arg InsertRunParams) (int64, error)

InsertRun records a run as it starts, and returns its ID.

func (*Queries) ListRuns

func (q *Queries) ListRuns(ctx context.Context) ([]ScriptRun, error)

ListRuns returns every run, newest first.

func (*Queries) LiveRuns

func (q *Queries) LiveRuns(ctx context.Context) ([]ScriptRun, error)

LiveRuns returns every run that has not finished, oldest first.

func (*Queries) MarkRunSeen

func (q *Queries) MarkRunSeen(ctx context.Context, arg MarkRunSeenParams) (int64, error)

MarkRunSeen records that the user has seen a run.

func (*Queries) RunIDs

func (q *Queries) RunIDs(ctx context.Context) ([]int64, error)

RunIDs returns the ID of every run.

func (*Queries) SetRunProcess

func (q *Queries) SetRunProcess(ctx context.Context, arg SetRunProcessParams) error

SetRunProcess records a run's process, its group, and when the process started.

func (*Queries) SetRunStatus

func (q *Queries) SetRunStatus(ctx context.Context, arg SetRunStatusParams) (int64, error)

SetRunStatus changes the status and summary of a run that has not finished, as reconcile does for a run from before the app restarted that is still going.

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type ScriptRun

type ScriptRun struct {
	ID            int64
	Kind          string
	Title         string
	Source        string
	RepoOwner     string
	RepoName      string
	Dir           string
	Argv          string
	Command       string
	RunsIn        string
	Status        string
	ExitCode      *int64
	Pid           int64
	Pgid          int64
	ProcStartedAt *time.Time
	Summary       string
	Result        string
	LogBytes      int64
	SeenAt        *time.Time
	StartedAt     time.Time
	FinishedAt    *time.Time
}

type SetRunProcessParams

type SetRunProcessParams struct {
	Pid           int64
	Pgid          int64
	ProcStartedAt *time.Time
	ID            int64
}

type SetRunStatusParams

type SetRunStatusParams struct {
	Status  string
	Summary string
	ID      int64
}

Jump to

Keyboard shortcuts

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