sqlc

package
v0.0.0-...-ebf8853 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	ID                 int64
	Label              string
	Type               sql.NullString
	Success            sql.NullBool
	ExitCode           sql.NullInt32
	CommandLine        pqtype.NullRawMessage
	StartTime          sql.NullTime
	EndTime            sql.NullTime
	FailureCode        sql.NullString
	FailureMessage     sql.NullString
	StdoutHash         sql.NullString
	StdoutSizeBytes    sql.NullInt64
	StdoutHashFunction sql.NullString
	StderrHash         sql.NullString
	StderrSizeBytes    sql.NullInt64
	StderrHashFunction sql.NullString
	ConfigurationID    int64
	BazelInvocationID  int64
}

type ActionCacheStatistic

type ActionCacheStatistic struct {
	ID                                 int64
	SizeInBytes                        sql.NullInt64
	SaveTimeInMs                       sql.NullInt64
	LoadTimeInMs                       sql.NullInt64
	Hits                               sql.NullInt32
	Misses                             sql.NullInt32
	ActionSummaryActionCacheStatistics sql.NullInt64
}

type ActionDatum

type ActionDatum struct {
	ID                      int64
	Mnemonic                sql.NullString
	ActionsExecuted         sql.NullInt64
	ActionsCreated          sql.NullInt64
	FirstStartedMs          sql.NullInt64
	LastEndedMs             sql.NullInt64
	SystemTime              sql.NullInt64
	UserTime                sql.NullInt64
	ActionSummaryActionData sql.NullInt64
}

type ActionSummary

type ActionSummary struct {
	ID                                int64
	ActionsCreated                    sql.NullInt64
	ActionsCreatedNotIncludingAspects sql.NullInt64
	ActionsExecuted                   sql.NullInt64
	RemoteCacheHits                   sql.NullInt64
	MetricsActionSummary              sql.NullInt64
}

type ArtifactMetric

type ArtifactMetric struct {
	ID                                        int64
	SourceArtifactsReadSizeInBytes            sql.NullInt64
	SourceArtifactsReadCount                  sql.NullInt32
	OutputArtifactsSeenSizeInBytes            sql.NullInt64
	OutputArtifactsSeenCount                  sql.NullInt32
	OutputArtifactsFromActionCacheSizeInBytes sql.NullInt64
	OutputArtifactsFromActionCacheCount       sql.NullInt32
	TopLevelArtifactsSizeInBytes              sql.NullInt64
	TopLevelArtifactsCount                    sql.NullInt32
	MetricsArtifactMetrics                    sql.NullInt64
}

type AuthenticatedUser

type AuthenticatedUser struct {
	ID          int64
	UserUuid    uuid.UUID
	ExternalID  string
	DisplayName sql.NullString
	UserInfo    pqtype.NullRawMessage
}

type BazelInvocation

type BazelInvocation struct {
	ID                                  int64
	InvocationID                        uuid.UUID
	StartedAt                           sql.NullTime
	EndedAt                             sql.NullTime
	ChangeNumber                        sql.NullInt64
	PatchsetNumber                      sql.NullInt64
	BepCompleted                        bool
	StepLabel                           sql.NullString
	UserEmail                           sql.NullString
	UserLdap                            sql.NullString
	Hostname                            sql.NullString
	IsCiWorker                          sql.NullBool
	NumFetches                          sql.NullInt64
	ProfileName                         sql.NullString
	BazelVersion                        sql.NullString
	ExitCodeName                        sql.NullString
	ExitCodeCode                        sql.NullInt32
	CommandLineCommand                  sql.NullString
	CommandLineExecutable               sql.NullString
	CommandLineResidual                 sql.NullString
	CommandLine                         pqtype.NullRawMessage
	ExplicitCommandLine                 pqtype.NullRawMessage
	StartupOptions                      pqtype.NullRawMessage
	ExplicitStartupOptions              pqtype.NullRawMessage
	ProcessedEventStarted               bool
	ProcessedEventBuildMetadata         bool
	ProcessedEventOptionsParsed         bool
	ProcessedEventBuildFinished         bool
	ProcessedEventStructuredCommandLine bool
	ProcessedEventWorkspaceStatus       bool
	AuthenticatedUserBazelInvocations   sql.NullInt64
	BuildInvocations                    sql.NullInt64
	InstanceNameBazelInvocations        int64
}

type Build

type Build struct {
	ID                 int64
	BuildUrl           string
	BuildUuid          uuid.UUID
	Timestamp          time.Time
	InstanceNameBuilds int64
}

type BuildGraphMetric

type BuildGraphMetric struct {
	ID                                        int64
	ActionLookupValueCount                    sql.NullInt32
	ActionLookupValueCountNotIncludingAspects sql.NullInt32
	ActionCount                               sql.NullInt32
	ActionCountNotIncludingAspects            sql.NullInt32
	InputFileConfiguredTargetCount            sql.NullInt32
	OutputFileConfiguredTargetCount           sql.NullInt32
	OtherConfiguredTargetCount                sql.NullInt32
	OutputArtifactCount                       sql.NullInt32
	PostInvocationSkyframeNodeCount           sql.NullInt32
	BuildGraphMetricsDirtiedValues            sql.NullInt64
	BuildGraphMetricsChangedValues            sql.NullInt64
	BuildGraphMetricsBuiltValues              sql.NullInt64
	BuildGraphMetricsCleanedValues            sql.NullInt64
	MetricsBuildGraphMetrics                  sql.NullInt64
}

type BuildLogChunk

type BuildLogChunk struct {
	ID                            int64
	Data                          []byte
	ChunkIndex                    int64
	FirstLineIndex                int64
	LastLineIndex                 int64
	BazelInvocationBuildLogChunks int64
}

type Configuration

type Configuration struct {
	ID                int64
	ConfigurationID   string
	Mnemonic          sql.NullString
	PlatformName      sql.NullString
	Cpu               sql.NullString
	MakeVariables     pqtype.NullRawMessage
	IsTool            sql.NullBool
	BazelInvocationID int64
}

type ConnectionMetadatum

type ConnectionMetadatum struct {
	ID                                int64
	ConnectionLastOpenAt              time.Time
	BazelInvocationConnectionMetadata int64
}

type CreateBazelInvocationParams

type CreateBazelInvocationParams struct {
	InvocationID        uuid.UUID
	InstanceNameID      int64
	AuthenticatedUserID sql.NullInt64
}

type CreateIncompleteBuildLogsParams

type CreateIncompleteBuildLogsParams struct {
	BazelInvocationID int64
	SnippetIds        []int32
	LogSnippets       [][]byte
}

type CreateInvocationTargetsBulkParams

type CreateInvocationTargetsBulkParams struct {
	BazelInvocationID int64
	TargetIds         []int64
	ConfigurationIds  []string
	Successes         []bool
	TagsList          []string
	StartTimes        []int64
	EndTimes          []int64
	Durations         []int64
	FailureMessages   []string
	AbortReasons      []string
}

type CreateTargetKindMappingsBulkParams

type CreateTargetKindMappingsBulkParams struct {
	BazelInvocationID int64
	TargetIds         []int64
	StartTimes        []int64
}

type CreateTargetsParams

type CreateTargetsParams struct {
	InstanceNameID int64
	Labels         []string
	Aspects        []string
	TargetKinds    []string
}

type CreateTargetsRow

type CreateTargetsRow struct {
	ID         int64
	Label      string
	Aspect     string
	TargetKind string
}

type CreateTestResultsBulkParams

type CreateTestResultsBulkParams struct {
	InstanceNameID       int64
	Labels               []string
	ConfigIds            []string
	Runs                 []int32
	Shards               []int32
	Attempts             []int32
	Statuses             []string
	StatusDetailss       []string
	CachedLocallys       []bool
	TestAttemptStarts    []time.Time
	TestAttemptDurations []int64
	Warnings             []string
	Strategies           []string
	CachedRemotelys      []bool
	ExitCodes            []int32
	Hostnames            []string
	TimingBreakdowns     []string
	BazelInvocationID    int64
}

type CreateTestSummariesBulkParams

type CreateTestSummariesBulkParams struct {
	InstanceNameID    int64
	Labels            []string
	ConfigIds         []string
	BazelInvocationID int64
}

type CumulativeMetric

type CumulativeMetric struct {
	ID                       int64
	NumAnalyses              sql.NullInt32
	NumBuilds                sql.NullInt32
	MetricsCumulativeMetrics sql.NullInt64
}

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 EvaluationStat

type EvaluationStat struct {
	ID                               int64
	SkyfunctionName                  sql.NullString
	Count                            sql.NullInt64
	BuildGraphMetricsEvaluatedValues sql.NullInt64
}

type EventMetadatum

type EventMetadatum struct {
	ID                int64
	Handled           []byte
	EventReceivedAt   time.Time
	Version           int64
	BazelInvocationID int64
}

type FindMappedTargetsParams

type FindMappedTargetsParams struct {
	Labels            []string
	Aspects           []string
	BazelInvocationID int64
}

type FindMappedTargetsRow

type FindMappedTargetsRow struct {
	Label         string
	Aspect        string
	TargetID      int64
	StartTimeInMs sql.NullInt64
}

type FindTargetsParams

type FindTargetsParams struct {
	InstanceNameID int64
	Labels         []string
	Aspects        []string
	TargetKinds    []string
}

type FindTargetsRow

type FindTargetsRow struct {
	ID         int64
	Label      string
	Aspect     string
	TargetKind string
}

type GarbageMetric

type GarbageMetric struct {
	ID                          int64
	Type                        sql.NullString
	GarbageCollected            sql.NullInt64
	MemoryMetricsGarbageMetrics sql.NullInt64
}

type GetOrCreateEventMetadataRow

type GetOrCreateEventMetadataRow struct {
	ID              int64
	Handled         []byte
	EventReceivedAt time.Time
	Version         int64
}

type IncompleteBuildLog

type IncompleteBuildLog struct {
	ID                int64
	SnippetID         int32
	LogSnippet        []byte
	BazelInvocationID int64
}

type InstanceName

type InstanceName struct {
	ID   int64
	Name string
}

type InvocationFile

type InvocationFile struct {
	ID                             int64
	Name                           string
	Content                        sql.NullString
	Digest                         sql.NullString
	SizeBytes                      sql.NullInt64
	DigestFunction                 sql.NullString
	BazelInvocationInvocationFiles sql.NullInt64
}

type InvocationTarget

type InvocationTarget struct {
	ID                               int64
	Success                          bool
	Tags                             pqtype.NullRawMessage
	StartTimeInMs                    sql.NullInt64
	EndTimeInMs                      sql.NullInt64
	DurationInMs                     sql.NullInt64
	FailureMessage                   sql.NullString
	AbortReason                      string
	BazelInvocationInvocationTargets int64
	InvocationTargetConfiguration    sql.NullInt64
	TargetInvocationTargets          int64
}

type LockBazelInvocationCompletionRow

type LockBazelInvocationCompletionRow struct {
	ID           int64
	BepCompleted bool
}

type MemoryMetric

type MemoryMetric struct {
	ID                             int64
	PeakPostGcHeapSize             sql.NullInt64
	UsedHeapSizePostBuild          sql.NullInt64
	PeakPostGcTenuredSpaceHeapSize sql.NullInt64
	MetricsMemoryMetrics           sql.NullInt64
}

type Metric

type Metric struct {
	ID                     int64
	BazelInvocationMetrics sql.NullInt64
}

type MissDetail

type MissDetail struct {
	ID                               int64
	Reason                           string
	Count                            sql.NullInt32
	ActionCacheStatisticsMissDetails sql.NullInt64
}

type NetworkMetric

type NetworkMetric struct {
	ID                    int64
	MetricsNetworkMetrics sql.NullInt64
}

type PackageLoadMetric

type PackageLoadMetric struct {
	ID                               int64
	Name                             sql.NullString
	LoadDuration                     sql.NullInt64
	NumTargets                       sql.NullInt64
	ComputationSteps                 sql.NullInt64
	NumTransitiveLoads               sql.NullInt64
	PackageOverhead                  sql.NullInt64
	PackageMetricsPackageLoadMetrics sql.NullInt64
}

type PackageMetric

type PackageMetric struct {
	ID                    int64
	PackagesLoaded        sql.NullInt64
	MetricsPackageMetrics sql.NullInt64
}

type Querier

type Querier interface {
	//
	// An idempotent function for creating bazel invocations. If the
	// invocation already exists, it will return the existing id.
	CreateBazelInvocation(ctx context.Context, arg CreateBazelInvocationParams) (int64, error)
	CreateIncompleteBuildLogs(ctx context.Context, arg CreateIncompleteBuildLogsParams) error
	//
	// An idempotent function for creating an instance name. If the instance
	// name already exists, it will return the existing id.
	CreateInstanceName(ctx context.Context, name string) (int64, error)
	CreateInvocationTargetsBulk(ctx context.Context, arg CreateInvocationTargetsBulkParams) error
	CreateTargetKindMappingsBulk(ctx context.Context, arg CreateTargetKindMappingsBulkParams) error
	// ORDER BY here is enforcing an insertion order for two reasons:
	//   1. Prevent concurrent requests from deadlocking each other in case
	// they have overlapping insertions of targets in different orders.
	//   2. Explicitly collate to normalize sort order between database
	// instantiations, otherwise golden file generation may have a different
	// order than what's used during the test.
	CreateTargets(ctx context.Context, arg CreateTargetsParams) ([]CreateTargetsRow, error)
	// STAGE 2: Join the rest using the specific Target IDs we found
	CreateTestResultsBulk(ctx context.Context, arg CreateTestResultsBulkParams) (int64, error)
	// STAGE 2: Join the rest using the specific Target IDs we found
	CreateTestSummariesBulk(ctx context.Context, arg CreateTestSummariesBulkParams) (int64, error)
	FindMappedTargets(ctx context.Context, arg FindMappedTargetsParams) ([]FindMappedTargetsRow, error)
	FindTargets(ctx context.Context, arg FindTargetsParams) ([]FindTargetsRow, error)
	GetOrCreateEventMetadata(ctx context.Context, bazelInvocationID int64) (GetOrCreateEventMetadataRow, error)
	LockBazelInvocationCompletion(ctx context.Context, id int64) (LockBazelInvocationCompletionRow, error)
	UpdateCompletedInvocationWithEndTimeFromEventMetadata(ctx context.Context) (int64, error)
	UpdateEventMetadata(ctx context.Context, arg UpdateEventMetadataParams) (int64, error)
	UpdateTestSummariesBulk(ctx context.Context, arg UpdateTestSummariesBulkParams) (int64, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateBazelInvocation

func (q *Queries) CreateBazelInvocation(ctx context.Context, arg CreateBazelInvocationParams) (int64, error)

An idempotent function for creating bazel invocations. If the invocation already exists, it will return the existing id.

func (*Queries) CreateIncompleteBuildLogs

func (q *Queries) CreateIncompleteBuildLogs(ctx context.Context, arg CreateIncompleteBuildLogsParams) error

func (*Queries) CreateInstanceName

func (q *Queries) CreateInstanceName(ctx context.Context, name string) (int64, error)

An idempotent function for creating an instance name. If the instance name already exists, it will return the existing id.

func (*Queries) CreateInvocationTargetsBulk

func (q *Queries) CreateInvocationTargetsBulk(ctx context.Context, arg CreateInvocationTargetsBulkParams) error

func (*Queries) CreateTargetKindMappingsBulk

func (q *Queries) CreateTargetKindMappingsBulk(ctx context.Context, arg CreateTargetKindMappingsBulkParams) error

func (*Queries) CreateTargets

func (q *Queries) CreateTargets(ctx context.Context, arg CreateTargetsParams) ([]CreateTargetsRow, error)

ORDER BY here is enforcing an insertion order for two reasons:

  1. Prevent concurrent requests from deadlocking each other in case

they have overlapping insertions of targets in different orders.

  1. Explicitly collate to normalize sort order between database

instantiations, otherwise golden file generation may have a different order than what's used during the test.

func (*Queries) CreateTestResultsBulk

func (q *Queries) CreateTestResultsBulk(ctx context.Context, arg CreateTestResultsBulkParams) (int64, error)

STAGE 2: Join the rest using the specific Target IDs we found

func (*Queries) CreateTestSummariesBulk

func (q *Queries) CreateTestSummariesBulk(ctx context.Context, arg CreateTestSummariesBulkParams) (int64, error)

STAGE 2: Join the rest using the specific Target IDs we found

func (*Queries) FindMappedTargets

func (q *Queries) FindMappedTargets(ctx context.Context, arg FindMappedTargetsParams) ([]FindMappedTargetsRow, error)

func (*Queries) FindTargets

func (q *Queries) FindTargets(ctx context.Context, arg FindTargetsParams) ([]FindTargetsRow, error)

func (*Queries) GetOrCreateEventMetadata

func (q *Queries) GetOrCreateEventMetadata(ctx context.Context, bazelInvocationID int64) (GetOrCreateEventMetadataRow, error)

func (*Queries) LockBazelInvocationCompletion

func (q *Queries) LockBazelInvocationCompletion(ctx context.Context, id int64) (LockBazelInvocationCompletionRow, error)

func (*Queries) UpdateCompletedInvocationWithEndTimeFromEventMetadata

func (q *Queries) UpdateCompletedInvocationWithEndTimeFromEventMetadata(ctx context.Context) (int64, error)

func (*Queries) UpdateEventMetadata

func (q *Queries) UpdateEventMetadata(ctx context.Context, arg UpdateEventMetadataParams) (int64, error)

func (*Queries) UpdateTestSummariesBulk

func (q *Queries) UpdateTestSummariesBulk(ctx context.Context, arg UpdateTestSummariesBulkParams) (int64, error)

func (*Queries) WithTx

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

type RunnerCount

type RunnerCount struct {
	ID                       int64
	Name                     sql.NullString
	ExecKind                 sql.NullString
	ActionsExecuted          sql.NullInt64
	ActionSummaryRunnerCount sql.NullInt64
}

type SourceControl

type SourceControl struct {
	ID                           int64
	Provider                     sql.NullString
	InstanceUrl                  sql.NullString
	Repo                         sql.NullString
	Refs                         sql.NullString
	CommitSha                    sql.NullString
	Actor                        sql.NullString
	EventName                    sql.NullString
	Workflow                     sql.NullString
	RunID                        sql.NullString
	RunNumber                    sql.NullString
	Job                          sql.NullString
	Action                       sql.NullString
	RunnerName                   sql.NullString
	RunnerArch                   sql.NullString
	RunnerOs                     sql.NullString
	Workspace                    sql.NullString
	BazelInvocationSourceControl sql.NullInt64
}

type SystemNetworkStat

type SystemNetworkStat struct {
	ID                               int64
	BytesSent                        sql.NullInt64
	BytesRecv                        sql.NullInt64
	PacketsSent                      sql.NullInt64
	PacketsRecv                      sql.NullInt64
	PeakBytesSentPerSec              sql.NullInt64
	PeakBytesRecvPerSec              sql.NullInt64
	PeakPacketsSentPerSec            sql.NullInt64
	PeakPacketsRecvPerSec            sql.NullInt64
	NetworkMetricsSystemNetworkStats sql.NullInt64
}

type Target

type Target struct {
	ID                  int64
	Label               string
	Aspect              string
	TargetKind          string
	InstanceNameTargets int64
}

type TargetKindMapping

type TargetKindMapping struct {
	ID                int64
	StartTimeInMs     sql.NullInt64
	BazelInvocationID int64
	TargetID          int64
}

type TargetMetric

type TargetMetric struct {
	ID                                   int64
	TargetsLoaded                        sql.NullInt64
	TargetsConfigured                    sql.NullInt64
	TargetsConfiguredNotIncludingAspects sql.NullInt64
	MetricsTargetMetrics                 sql.NullInt64
}

type TestResult

type TestResult struct {
	ID                      int64
	Run                     int32
	Shard                   int32
	Attempt                 int32
	Status                  sql.NullString
	StatusDetails           sql.NullString
	CachedLocally           sql.NullBool
	TestAttemptStart        sql.NullTime
	TestAttemptDurationInMs sql.NullInt64
	Warning                 pqtype.NullRawMessage
	Strategy                sql.NullString
	CachedRemotely          sql.NullBool
	ExitCode                sql.NullInt32
	Hostname                sql.NullString
	TimingBreakdown         pqtype.NullRawMessage
	TestSummaryTestResults  int64
}

type TestSummary

type TestSummary struct {
	ID                          int64
	OverallStatus               sql.NullString
	TotalRunCount               sql.NullInt32
	RunCount                    sql.NullInt32
	AttemptCount                sql.NullInt32
	ShardCount                  sql.NullInt32
	TotalNumCached              sql.NullInt32
	FirstStartTime              sql.NullTime
	LastStopTime                sql.NullTime
	TotalRunDurationInMs        sql.NullInt64
	InvocationTargetTestSummary int64
}

type TimingMetric

type TimingMetric struct {
	ID                        int64
	CpuTimeInMs               sql.NullInt64
	WallTimeInMs              sql.NullInt64
	AnalysisPhaseTimeInMs     sql.NullInt64
	ExecutionPhaseTimeInMs    sql.NullInt64
	ActionsExecutionStartInMs sql.NullInt64
	MetricsTimingMetrics      sql.NullInt64
}

type UpdateEventMetadataParams

type UpdateEventMetadataParams struct {
	Handled         []byte
	EventReceivedAt time.Time
	ID              int64
	Version         int64
}

type UpdateTestSummariesBulkParams

type UpdateTestSummariesBulkParams struct {
	InstanceNameID    int64
	Labels            []string
	ConfigIds         []string
	OverallStatuses   []string
	TotalRunCounts    []int32
	RunCounts         []int32
	AttemptCounts     []int32
	ShardCounts       []int32
	TotalNumCacheds   []int32
	StartTimes        []time.Time
	StopTimes         []time.Time
	Durations         []int64
	BazelInvocationID int64
}

Jump to

Keyboard shortcuts

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