// Code generated by ent, DO NOT EDIT.

package buildgraphmetrics

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

const (
	// Label holds the string label denoting the buildgraphmetrics type in the database.
	Label = "build_graph_metrics"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldActionLookupValueCount holds the string denoting the action_lookup_value_count field in the database.
	FieldActionLookupValueCount = "action_lookup_value_count"
	// FieldActionLookupValueCountNotIncludingAspects holds the string denoting the action_lookup_value_count_not_including_aspects field in the database.
	FieldActionLookupValueCountNotIncludingAspects = "action_lookup_value_count_not_including_aspects"
	// FieldActionCount holds the string denoting the action_count field in the database.
	FieldActionCount = "action_count"
	// FieldActionCountNotIncludingAspects holds the string denoting the action_count_not_including_aspects field in the database.
	FieldActionCountNotIncludingAspects = "action_count_not_including_aspects"
	// FieldInputFileConfiguredTargetCount holds the string denoting the input_file_configured_target_count field in the database.
	FieldInputFileConfiguredTargetCount = "input_file_configured_target_count"
	// FieldOutputFileConfiguredTargetCount holds the string denoting the output_file_configured_target_count field in the database.
	FieldOutputFileConfiguredTargetCount = "output_file_configured_target_count"
	// FieldOtherConfiguredTargetCount holds the string denoting the other_configured_target_count field in the database.
	FieldOtherConfiguredTargetCount = "other_configured_target_count"
	// FieldOutputArtifactCount holds the string denoting the output_artifact_count field in the database.
	FieldOutputArtifactCount = "output_artifact_count"
	// FieldPostInvocationSkyframeNodeCount holds the string denoting the post_invocation_skyframe_node_count field in the database.
	FieldPostInvocationSkyframeNodeCount = "post_invocation_skyframe_node_count"
	// EdgeMetrics holds the string denoting the metrics edge name in mutations.
	EdgeMetrics = "metrics"
	// EdgeDirtiedValues holds the string denoting the dirtied_values edge name in mutations.
	EdgeDirtiedValues = "dirtied_values"
	// EdgeChangedValues holds the string denoting the changed_values edge name in mutations.
	EdgeChangedValues = "changed_values"
	// EdgeBuiltValues holds the string denoting the built_values edge name in mutations.
	EdgeBuiltValues = "built_values"
	// EdgeCleanedValues holds the string denoting the cleaned_values edge name in mutations.
	EdgeCleanedValues = "cleaned_values"
	// EdgeEvaluatedValues holds the string denoting the evaluated_values edge name in mutations.
	EdgeEvaluatedValues = "evaluated_values"
	// Table holds the table name of the buildgraphmetrics in the database.
	Table = "build_graph_metrics"
	// MetricsTable is the table that holds the metrics relation/edge.
	MetricsTable = "build_graph_metrics"
	// MetricsInverseTable is the table name for the Metrics entity.
	// It exists in this package in order to avoid circular dependency with the "metrics" package.
	MetricsInverseTable = "metrics"
	// MetricsColumn is the table column denoting the metrics relation/edge.
	MetricsColumn = "metrics_build_graph_metrics"
	// DirtiedValuesTable is the table that holds the dirtied_values relation/edge.
	DirtiedValuesTable = "build_graph_metrics"
	// DirtiedValuesInverseTable is the table name for the EvaluationStat entity.
	// It exists in this package in order to avoid circular dependency with the "evaluationstat" package.
	DirtiedValuesInverseTable = "evaluation_stats"
	// DirtiedValuesColumn is the table column denoting the dirtied_values relation/edge.
	DirtiedValuesColumn = "build_graph_metrics_dirtied_values"
	// ChangedValuesTable is the table that holds the changed_values relation/edge.
	ChangedValuesTable = "build_graph_metrics"
	// ChangedValuesInverseTable is the table name for the EvaluationStat entity.
	// It exists in this package in order to avoid circular dependency with the "evaluationstat" package.
	ChangedValuesInverseTable = "evaluation_stats"
	// ChangedValuesColumn is the table column denoting the changed_values relation/edge.
	ChangedValuesColumn = "build_graph_metrics_changed_values"
	// BuiltValuesTable is the table that holds the built_values relation/edge.
	BuiltValuesTable = "build_graph_metrics"
	// BuiltValuesInverseTable is the table name for the EvaluationStat entity.
	// It exists in this package in order to avoid circular dependency with the "evaluationstat" package.
	BuiltValuesInverseTable = "evaluation_stats"
	// BuiltValuesColumn is the table column denoting the built_values relation/edge.
	BuiltValuesColumn = "build_graph_metrics_built_values"
	// CleanedValuesTable is the table that holds the cleaned_values relation/edge.
	CleanedValuesTable = "build_graph_metrics"
	// CleanedValuesInverseTable is the table name for the EvaluationStat entity.
	// It exists in this package in order to avoid circular dependency with the "evaluationstat" package.
	CleanedValuesInverseTable = "evaluation_stats"
	// CleanedValuesColumn is the table column denoting the cleaned_values relation/edge.
	CleanedValuesColumn = "build_graph_metrics_cleaned_values"
	// EvaluatedValuesTable is the table that holds the evaluated_values relation/edge.
	EvaluatedValuesTable = "evaluation_stats"
	// EvaluatedValuesInverseTable is the table name for the EvaluationStat entity.
	// It exists in this package in order to avoid circular dependency with the "evaluationstat" package.
	EvaluatedValuesInverseTable = "evaluation_stats"
	// EvaluatedValuesColumn is the table column denoting the evaluated_values relation/edge.
	EvaluatedValuesColumn = "build_graph_metrics_evaluated_values"
)

// Columns holds all SQL columns for buildgraphmetrics fields.
var Columns = []string{
	FieldID,
	FieldActionLookupValueCount,
	FieldActionLookupValueCountNotIncludingAspects,
	FieldActionCount,
	FieldActionCountNotIncludingAspects,
	FieldInputFileConfiguredTargetCount,
	FieldOutputFileConfiguredTargetCount,
	FieldOtherConfiguredTargetCount,
	FieldOutputArtifactCount,
	FieldPostInvocationSkyframeNodeCount,
}

// ForeignKeys holds the SQL foreign-keys that are owned by the "build_graph_metrics"
// table and are not defined as standalone fields in the schema.
var ForeignKeys = []string{
	"build_graph_metrics_dirtied_values",
	"build_graph_metrics_changed_values",
	"build_graph_metrics_built_values",
	"build_graph_metrics_cleaned_values",
	"metrics_build_graph_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 BuildGraphMetrics 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()
}

// ByActionLookupValueCount orders the results by the action_lookup_value_count field.
func ByActionLookupValueCount(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldActionLookupValueCount, opts...).ToFunc()
}

// ByActionLookupValueCountNotIncludingAspects orders the results by the action_lookup_value_count_not_including_aspects field.
func ByActionLookupValueCountNotIncludingAspects(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldActionLookupValueCountNotIncludingAspects, opts...).ToFunc()
}

// ByActionCount orders the results by the action_count field.
func ByActionCount(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldActionCount, opts...).ToFunc()
}

// ByActionCountNotIncludingAspects orders the results by the action_count_not_including_aspects field.
func ByActionCountNotIncludingAspects(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldActionCountNotIncludingAspects, opts...).ToFunc()
}

// ByInputFileConfiguredTargetCount orders the results by the input_file_configured_target_count field.
func ByInputFileConfiguredTargetCount(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldInputFileConfiguredTargetCount, opts...).ToFunc()
}

// ByOutputFileConfiguredTargetCount orders the results by the output_file_configured_target_count field.
func ByOutputFileConfiguredTargetCount(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldOutputFileConfiguredTargetCount, opts...).ToFunc()
}

// ByOtherConfiguredTargetCount orders the results by the other_configured_target_count field.
func ByOtherConfiguredTargetCount(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldOtherConfiguredTargetCount, opts...).ToFunc()
}

// ByOutputArtifactCount orders the results by the output_artifact_count field.
func ByOutputArtifactCount(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldOutputArtifactCount, opts...).ToFunc()
}

// ByPostInvocationSkyframeNodeCount orders the results by the post_invocation_skyframe_node_count field.
func ByPostInvocationSkyframeNodeCount(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldPostInvocationSkyframeNodeCount, opts...).ToFunc()
}

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

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

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

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

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

// ByEvaluatedValuesField orders the results by evaluated_values field.
func ByEvaluatedValuesField(field string, opts ...sql.OrderTermOption) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborTerms(s, newEvaluatedValuesStep(), sql.OrderByField(field, opts...))
	}
}
func newMetricsStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(MetricsInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.O2O, true, MetricsTable, MetricsColumn),
	)
}
func newDirtiedValuesStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(DirtiedValuesInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.M2O, false, DirtiedValuesTable, DirtiedValuesColumn),
	)
}
func newChangedValuesStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(ChangedValuesInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.M2O, false, ChangedValuesTable, ChangedValuesColumn),
	)
}
func newBuiltValuesStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(BuiltValuesInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.M2O, false, BuiltValuesTable, BuiltValuesColumn),
	)
}
func newCleanedValuesStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(CleanedValuesInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.M2O, false, CleanedValuesTable, CleanedValuesColumn),
	)
}
func newEvaluatedValuesStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(EvaluatedValuesInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.O2O, false, EvaluatedValuesTable, EvaluatedValuesColumn),
	)
}
