database

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type GetJobDetailsRow

type GetJobDetailsRow struct {
	JobID              string           `db:"job_id"`
	Queue              string           `db:"queue"`
	Jobset             string           `db:"jobset"`
	Namespace          *string          `db:"namespace"`
	State              int16            `db:"state"`
	Submitted          pgtype.Timestamp `db:"submitted"`
	Cancelled          pgtype.Timestamp `db:"cancelled"`
	CancelReason       *string          `db:"cancel_reason"`
	LastTransitionTime pgtype.Timestamp `db:"last_transition_time"`
	LatestRunID        *string          `db:"latest_run_id"`
	JobSpec            []byte           `db:"job_spec"`
}

type GetJobErrorsByJobIdsRow added in v0.15.0

type GetJobErrorsByJobIdsRow struct {
	JobID string `db:"job_id"`
	Error []byte `db:"error"`
}

type GetJobStatesRow

type GetJobStatesRow struct {
	JobID string `db:"job_id"`
	State int16  `db:"state"`
}

type GetJobStatesUsingExternalSystemUriParams added in v0.15.0

type GetJobStatesUsingExternalSystemUriParams struct {
	Queue          string `db:"queue"`
	Jobset         string `db:"jobset"`
	ExternalJobUri string `db:"external_job_uri"`
}

type GetJobStatesUsingExternalSystemUriRow added in v0.15.0

type GetJobStatesUsingExternalSystemUriRow struct {
	JobID string `db:"job_id"`
	State int16  `db:"state"`
}

type Job

type Job struct {
	JobID                     string           `db:"job_id"`
	Queue                     string           `db:"queue"`
	Owner                     string           `db:"owner"`
	Jobset                    string           `db:"jobset"`
	Cpu                       int64            `db:"cpu"`
	Memory                    int64            `db:"memory"`
	EphemeralStorage          int64            `db:"ephemeral_storage"`
	Gpu                       int64            `db:"gpu"`
	Priority                  int64            `db:"priority"`
	Submitted                 pgtype.Timestamp `db:"submitted"`
	Cancelled                 pgtype.Timestamp `db:"cancelled"`
	State                     int16            `db:"state"`
	LastTransitionTime        pgtype.Timestamp `db:"last_transition_time"`
	LastTransitionTimeSeconds int64            `db:"last_transition_time_seconds"`
	JobSpec                   []byte           `db:"job_spec"`
	Duplicate                 bool             `db:"duplicate"`
	PriorityClass             *string          `db:"priority_class"`
	LatestRunID               *string          `db:"latest_run_id"`
	CancelReason              *string          `db:"cancel_reason"`
	Namespace                 *string          `db:"namespace"`
	Annotations               []byte           `db:"annotations"`
	ExternalJobUri            *string          `db:"external_job_uri"`
}

type JobDeduplication added in v0.13.0

type JobDeduplication struct {
	DeduplicationID string           `db:"deduplication_id"`
	JobID           string           `db:"job_id"`
	Inserted        pgtype.Timestamp `db:"inserted"`
}

type JobError added in v0.13.0

type JobError struct {
	JobID string `db:"job_id"`
	Error []byte `db:"error"`
}

type JobRun

type JobRun struct {
	RunID       string           `db:"run_id"`
	JobID       string           `db:"job_id"`
	Cluster     string           `db:"cluster"`
	Node        *string          `db:"node"`
	Pending     pgtype.Timestamp `db:"pending"`
	Started     pgtype.Timestamp `db:"started"`
	Finished    pgtype.Timestamp `db:"finished"`
	JobRunState int16            `db:"job_run_state"`
	Error       []byte           `db:"error"`
	ExitCode    *int32           `db:"exit_code"`
	Leased      pgtype.Timestamp `db:"leased"`
	Debug       []byte           `db:"debug"`
}

type JobSpec added in v0.13.0

type JobSpec struct {
	JobID   string `db:"job_id"`
	JobSpec []byte `db:"job_spec"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) GetJobDetails

func (q *Queries) GetJobDetails(ctx context.Context, jobIds []string) ([]GetJobDetailsRow, error)

func (*Queries) GetJobErrorsByJobIds added in v0.15.0

func (q *Queries) GetJobErrorsByJobIds(ctx context.Context, jobIds []string) ([]GetJobErrorsByJobIdsRow, error)

func (*Queries) GetJobRunsByJobIds

func (q *Queries) GetJobRunsByJobIds(ctx context.Context, jobIds []string) ([]JobRun, error)

func (*Queries) GetJobRunsByRunIds

func (q *Queries) GetJobRunsByRunIds(ctx context.Context, runIds []string) ([]JobRun, error)

func (*Queries) GetJobStates

func (q *Queries) GetJobStates(ctx context.Context, jobIds []string) ([]GetJobStatesRow, error)

func (*Queries) GetJobStatesUsingExternalSystemUri added in v0.15.0

func (*Queries) WithTx

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

type Queue added in v0.13.0

type Queue struct {
	Name       string `db:"name"`
	Definition []byte `db:"definition"`
}

Jump to

Keyboard shortcuts

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