Help us shape the future of Go! Take the 2026 Go Developer Survey

postgres

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListRunsFilter

type ListRunsFilter struct {
	RunID       string
	Status      string
	ProjectName string
	Marker      string
}

type MarkerInfo

type MarkerInfo struct {
	Marker string `json:"marker"`
	Count  int64  `json:"count"`
}

type PostgresRepository

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

PostgresRepository handles PostgreSQL operations for relational execution data.

func NewPostgresRepository

func NewPostgresRepository(db *gorm.DB, logger *slog.Logger) *PostgresRepository

NewPostgresRepository creates a new PostgreSQL repository.

func (*PostgresRepository) AppendTestError

func (r *PostgresRepository) AppendTestError(ctx context.Context, runID, executionID, testID string, attemptIndex int32, errorDoc *m.TestErrorDocument) error

AppendTestError adds an error document to the specified test attempt.

func (*PostgresRepository) AppendTestFailure

func (r *PostgresRepository) AppendTestFailure(ctx context.Context, runID, executionID, testID string, attemptIndex int32, failure *m.TestFailureDocument) error

AppendTestFailure adds a failure document to the specified test attempt.

func (*PostgresRepository) DeleteRuns

func (r *PostgresRepository) DeleteRuns(ctx context.Context, runIDs []string) (int64, error)

func (*PostgresRepository) FinalizeTestEnd

func (r *PostgresRepository) FinalizeTestEnd(ctx context.Context, test *m.Test, attempt *m.TestAttempt) error

FinalizeTestEnd applies terminal state to the relational test row and current attempt.

func (*PostgresRepository) FindAttachmentByStorageKey

func (r *PostgresRepository) FindAttachmentByStorageKey(ctx context.Context, storageKey string) (map[string]interface{}, error)

func (*PostgresRepository) GetAllRunStats added in v0.5.0

func (r *PostgresRepository) GetAllRunStats(ctx context.Context, limit int64, offset int64) ([]m.RunStat, error)

func (*PostgresRepository) GetRun added in v0.2.4

func (r *PostgresRepository) GetRun(ctx context.Context, runID string, includeSteps bool) (*m.TestRun, error)

func (*PostgresRepository) GetRunMetadataByIDs added in v0.5.0

func (r *PostgresRepository) GetRunMetadataByIDs(ctx context.Context, runIDs []string) (map[string]map[string]interface{}, error)

GetRunMetadataByIDs returns run metadata keyed by run ID. It intentionally reads from runs to keep run_stats queries focused on stats only.

func (*PostgresRepository) GetRunStatsByMarker added in v0.8.1

func (r *PostgresRepository) GetRunStatsByMarker(ctx context.Context, marker string) ([]m.RunStat, error)

func (*PostgresRepository) GetRuns added in v0.2.4

func (r *PostgresRepository) GetRuns(ctx context.Context, filter ListRunsFilter, limit, offset int64, includeSteps bool) ([]*m.TestRun, int64, error)

func (*PostgresRepository) GetTestTrends

func (r *PostgresRepository) GetTestTrends(ctx context.Context, testID string, limit int64) ([]*TestTrendItem, error)

func (*PostgresRepository) GetUniqueMarkers

func (r *PostgresRepository) GetUniqueMarkers(ctx context.Context) ([]*MarkerInfo, error)

func (*PostgresRepository) HandleRunEnd added in v0.6.0

func (*PostgresRepository) HandleRunStart added in v0.6.0

HandleRunStart handles the ReportRunStartEventRequest by creating or updating the TestRun and associated RunExecution, Suites, and Tests. It ensures that sharded run metadata is merged correctly and that existing records are updated rather than duplicated.

func (*PostgresRepository) IsConfigured

func (r *PostgresRepository) IsConfigured() bool

func (*PostgresRepository) ListRuns

func (r *PostgresRepository) ListRuns(ctx context.Context, filter ListRunsFilter, limit, offset int64) ([]*m.TestRun, int64, error)

func (*PostgresRepository) RemoveRunsMarker

func (r *PostgresRepository) RemoveRunsMarker(ctx context.Context, runIDs []string) (int64, error)

func (*PostgresRepository) UpdateRunsMarker

func (r *PostgresRepository) UpdateRunsMarker(ctx context.Context, runIDs []string, marker string) (int64, error)

func (*PostgresRepository) UpsertSuite added in v0.3.0

func (r *PostgresRepository) UpsertSuite(ctx context.Context, suite *m.Suite) error

func (*PostgresRepository) UpsertTestBegin

func (r *PostgresRepository) UpsertTestBegin(ctx context.Context, test *m.Test, attempt *m.TestAttempt) error

UpsertTestBegin creates or updates the relational test row and its current attempt.

type TestTrendItem

type TestTrendItem struct {
	TestID    string     `json:"testId"`
	RunID     string     `json:"runId"`
	Status    string     `json:"status"`
	Duration  *int64     `json:"duration,omitempty"`
	StartTime *time.Time `json:"startTime,omitempty"`
	EndTime   *time.Time `json:"endTime,omitempty"`
	CreatedAt time.Time  `json:"createdAt"`
}

Jump to

Keyboard shortcuts

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