// Code generated by ent, DO NOT EDIT.

package metrics

import (
	"entgo.io/ent/dialect/sql"
	"entgo.io/ent/dialect/sql/sqlgraph"
)

const (
	// Label holds the string label denoting the metrics type in the database.
	Label = "metrics"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// EdgeBazelInvocation holds the string denoting the bazel_invocation edge name in mutations.
	EdgeBazelInvocation = "bazel_invocation"
	// EdgeActionSummary holds the string denoting the action_summary edge name in mutations.
	EdgeActionSummary = "action_summary"
	// EdgeMemoryMetrics holds the string denoting the memory_metrics edge name in mutations.
	EdgeMemoryMetrics = "memory_metrics"
	// EdgeTargetMetrics holds the string denoting the target_metrics edge name in mutations.
	EdgeTargetMetrics = "target_metrics"
	// EdgePackageMetrics holds the string denoting the package_metrics edge name in mutations.
	EdgePackageMetrics = "package_metrics"
	// EdgeTimingMetrics holds the string denoting the timing_metrics edge name in mutations.
	EdgeTimingMetrics = "timing_metrics"
	// EdgeCumulativeMetrics holds the string denoting the cumulative_metrics edge name in mutations.
	EdgeCumulativeMetrics = "cumulative_metrics"
	// EdgeArtifactMetrics holds the string denoting the artifact_metrics edge name in mutations.
	EdgeArtifactMetrics = "artifact_metrics"
	// EdgeNetworkMetrics holds the string denoting the network_metrics edge name in mutations.
	EdgeNetworkMetrics = "network_metrics"
	// EdgeDynamicExecutionMetrics holds the string denoting the dynamic_execution_metrics edge name in mutations.
	EdgeDynamicExecutionMetrics = "dynamic_execution_metrics"
	// EdgeBuildGraphMetrics holds the string denoting the build_graph_metrics edge name in mutations.
	EdgeBuildGraphMetrics = "build_graph_metrics"
	// Table holds the table name of the metrics in the database.
	Table = "metrics"
	// BazelInvocationTable is the table that holds the bazel_invocation relation/edge.
	BazelInvocationTable = "metrics"
	// BazelInvocationInverseTable is the table name for the BazelInvocation entity.
	// It exists in this package in order to avoid circular dependency with the "bazelinvocation" package.
	BazelInvocationInverseTable = "bazel_invocations"
	// BazelInvocationColumn is the table column denoting the bazel_invocation relation/edge.
	BazelInvocationColumn = "bazel_invocation_metrics"
	// ActionSummaryTable is the table that holds the action_summary relation/edge.
	ActionSummaryTable = "action_summaries"
	// ActionSummaryInverseTable is the table name for the ActionSummary entity.
	// It exists in this package in order to avoid circular dependency with the "actionsummary" package.
	ActionSummaryInverseTable = "action_summaries"
	// ActionSummaryColumn is the table column denoting the action_summary relation/edge.
	ActionSummaryColumn = "metrics_action_summary"
	// MemoryMetricsTable is the table that holds the memory_metrics relation/edge.
	MemoryMetricsTable = "memory_metrics"
	// MemoryMetricsInverseTable is the table name for the MemoryMetrics entity.
	// It exists in this package in order to avoid circular dependency with the "memorymetrics" package.
	MemoryMetricsInverseTable = "memory_metrics"
	// MemoryMetricsColumn is the table column denoting the memory_metrics relation/edge.
	MemoryMetricsColumn = "metrics_memory_metrics"
	// TargetMetricsTable is the table that holds the target_metrics relation/edge.
	TargetMetricsTable = "target_metrics"
	// TargetMetricsInverseTable is the table name for the TargetMetrics entity.
	// It exists in this package in order to avoid circular dependency with the "targetmetrics" package.
	TargetMetricsInverseTable = "target_metrics"
	// TargetMetricsColumn is the table column denoting the target_metrics relation/edge.
	TargetMetricsColumn = "metrics_target_metrics"
	// PackageMetricsTable is the table that holds the package_metrics relation/edge.
	PackageMetricsTable = "package_metrics"
	// PackageMetricsInverseTable is the table name for the PackageMetrics entity.
	// It exists in this package in order to avoid circular dependency with the "packagemetrics" package.
	PackageMetricsInverseTable = "package_metrics"
	// PackageMetricsColumn is the table column denoting the package_metrics relation/edge.
	PackageMetricsColumn = "metrics_package_metrics"
	// TimingMetricsTable is the table that holds the timing_metrics relation/edge.
	TimingMetricsTable = "timing_metrics"
	// TimingMetricsInverseTable is the table name for the TimingMetrics entity.
	// It exists in this package in order to avoid circular dependency with the "timingmetrics" package.
	TimingMetricsInverseTable = "timing_metrics"
	// TimingMetricsColumn is the table column denoting the timing_metrics relation/edge.
	TimingMetricsColumn = "metrics_timing_metrics"
	// CumulativeMetricsTable is the table that holds the cumulative_metrics relation/edge.
	CumulativeMetricsTable = "cumulative_metrics"
	// CumulativeMetricsInverseTable is the table name for the CumulativeMetrics entity.
	// It exists in this package in order to avoid circular dependency with the "cumulativemetrics" package.
	CumulativeMetricsInverseTable = "cumulative_metrics"
	// CumulativeMetricsColumn is the table column denoting the cumulative_metrics relation/edge.
	CumulativeMetricsColumn = "metrics_cumulative_metrics"
	// ArtifactMetricsTable is the table that holds the artifact_metrics relation/edge.
	ArtifactMetricsTable = "artifact_metrics"
	// ArtifactMetricsInverseTable is the table name for the ArtifactMetrics entity.
	// It exists in this package in order to avoid circular dependency with the "artifactmetrics" package.
	ArtifactMetricsInverseTable = "artifact_metrics"
	// ArtifactMetricsColumn is the table column denoting the artifact_metrics relation/edge.
	ArtifactMetricsColumn = "metrics_artifact_metrics"
	// NetworkMetricsTable is the table that holds the network_metrics relation/edge.
	NetworkMetricsTable = "network_metrics"
	// NetworkMetricsInverseTable is the table name for the NetworkMetrics entity.
	// It exists in this package in order to avoid circular dependency with the "networkmetrics" package.
	NetworkMetricsInverseTable = "network_metrics"
	// NetworkMetricsColumn is the table column denoting the network_metrics relation/edge.
	NetworkMetricsColumn = "metrics_network_metrics"
	// DynamicExecutionMetricsTable is the table that holds the dynamic_execution_metrics relation/edge.
	DynamicExecutionMetricsTable = "dynamic_execution_metrics"
	// DynamicExecutionMetricsInverseTable is the table name for the DynamicExecutionMetrics entity.
	// It exists in this package in order to avoid circular dependency with the "dynamicexecutionmetrics" package.
	DynamicExecutionMetricsInverseTable = "dynamic_execution_metrics"
	// DynamicExecutionMetricsColumn is the table column denoting the dynamic_execution_metrics relation/edge.
	DynamicExecutionMetricsColumn = "metrics_dynamic_execution_metrics"
	// BuildGraphMetricsTable is the table that holds the build_graph_metrics relation/edge.
	BuildGraphMetricsTable = "build_graph_metrics"
	// BuildGraphMetricsInverseTable is the table name for the BuildGraphMetrics entity.
	// It exists in this package in order to avoid circular dependency with the "buildgraphmetrics" package.
	BuildGraphMetricsInverseTable = "build_graph_metrics"
	// BuildGraphMetricsColumn is the table column denoting the build_graph_metrics relation/edge.
	BuildGraphMetricsColumn = "metrics_build_graph_metrics"
)

// Columns holds all SQL columns for metrics fields.
var Columns = []string{
	FieldID,
}

// ForeignKeys holds the SQL foreign-keys that are owned by the "metrics"
// table and are not defined as standalone fields in the schema.
var ForeignKeys = []string{
	"bazel_invocation_metrics",
}

// ValidColumn reports if the column name is valid (part of the table columns).
func ValidColumn(column string) bool {
	for i := range Columns {
		if column == Columns[i] {
			return true
		}
	}
	for i := range ForeignKeys {
		if column == ForeignKeys[i] {
			return true
		}
	}
	return false
}

// OrderOption defines the ordering options for the Metrics queries.
type OrderOption func(*sql.Selector)

// ByID orders the results by the id field.
func ByID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldID, opts...).ToFunc()
}

// ByBazelInvocationField orders the results by bazel_invocation field.
func ByBazelInvocationField(field string, opts ...sql.OrderTermOption) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborTerms(s, newBazelInvocationStep(), sql.OrderByField(field, opts...))
	}
}

// ByActionSummaryField orders the results by action_summary field.
func ByActionSummaryField(field string, opts ...sql.OrderTermOption) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborTerms(s, newActionSummaryStep(), sql.OrderByField(field, opts...))
	}
}

// ByMemoryMetricsField orders the results by memory_metrics field.
func ByMemoryMetricsField(field string, opts ...sql.OrderTermOption) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborTerms(s, newMemoryMetricsStep(), sql.OrderByField(field, opts...))
	}
}

// ByTargetMetricsField orders the results by target_metrics field.
func ByTargetMetricsField(field string, opts ...sql.OrderTermOption) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborTerms(s, newTargetMetricsStep(), sql.OrderByField(field, opts...))
	}
}

// ByPackageMetricsField orders the results by package_metrics field.
func ByPackageMetricsField(field string, opts ...sql.OrderTermOption) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborTerms(s, newPackageMetricsStep(), sql.OrderByField(field, opts...))
	}
}

// ByTimingMetricsField orders the results by timing_metrics field.
func ByTimingMetricsField(field string, opts ...sql.OrderTermOption) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborTerms(s, newTimingMetricsStep(), sql.OrderByField(field, opts...))
	}
}

// ByCumulativeMetricsField orders the results by cumulative_metrics field.
func ByCumulativeMetricsField(field string, opts ...sql.OrderTermOption) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborTerms(s, newCumulativeMetricsStep(), sql.OrderByField(field, opts...))
	}
}

// ByArtifactMetricsField orders the results by artifact_metrics field.
func ByArtifactMetricsField(field string, opts ...sql.OrderTermOption) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborTerms(s, newArtifactMetricsStep(), sql.OrderByField(field, opts...))
	}
}

// ByNetworkMetricsField orders the results by network_metrics field.
func ByNetworkMetricsField(field string, opts ...sql.OrderTermOption) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborTerms(s, newNetworkMetricsStep(), sql.OrderByField(field, opts...))
	}
}

// ByDynamicExecutionMetricsField orders the results by dynamic_execution_metrics field.
func ByDynamicExecutionMetricsField(field string, opts ...sql.OrderTermOption) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborTerms(s, newDynamicExecutionMetricsStep(), sql.OrderByField(field, opts...))
	}
}

// ByBuildGraphMetricsField orders the results by build_graph_metrics field.
func ByBuildGraphMetricsField(field string, opts ...sql.OrderTermOption) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborTerms(s, newBuildGraphMetricsStep(), sql.OrderByField(field, opts...))
	}
}
func newBazelInvocationStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(BazelInvocationInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.O2O, true, BazelInvocationTable, BazelInvocationColumn),
	)
}
func newActionSummaryStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(ActionSummaryInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.O2O, false, ActionSummaryTable, ActionSummaryColumn),
	)
}
func newMemoryMetricsStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(MemoryMetricsInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.O2O, false, MemoryMetricsTable, MemoryMetricsColumn),
	)
}
func newTargetMetricsStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(TargetMetricsInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.O2O, false, TargetMetricsTable, TargetMetricsColumn),
	)
}
func newPackageMetricsStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(PackageMetricsInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.O2O, false, PackageMetricsTable, PackageMetricsColumn),
	)
}
func newTimingMetricsStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(TimingMetricsInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.O2O, false, TimingMetricsTable, TimingMetricsColumn),
	)
}
func newCumulativeMetricsStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(CumulativeMetricsInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.O2O, false, CumulativeMetricsTable, CumulativeMetricsColumn),
	)
}
func newArtifactMetricsStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(ArtifactMetricsInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.O2O, false, ArtifactMetricsTable, ArtifactMetricsColumn),
	)
}
func newNetworkMetricsStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(NetworkMetricsInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.O2O, false, NetworkMetricsTable, NetworkMetricsColumn),
	)
}
func newDynamicExecutionMetricsStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(DynamicExecutionMetricsInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.O2O, false, DynamicExecutionMetricsTable, DynamicExecutionMetricsColumn),
	)
}
func newBuildGraphMetricsStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(BuildGraphMetricsInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.O2O, false, BuildGraphMetricsTable, BuildGraphMetricsColumn),
	)
}
