// Code generated by ent, DO NOT EDIT.

package exectioninfo

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

const (
	// Label holds the string label denoting the exectioninfo type in the database.
	Label = "exection_info"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldTimeoutSeconds holds the string denoting the timeout_seconds field in the database.
	FieldTimeoutSeconds = "timeout_seconds"
	// FieldStrategy holds the string denoting the strategy field in the database.
	FieldStrategy = "strategy"
	// FieldCachedRemotely holds the string denoting the cached_remotely field in the database.
	FieldCachedRemotely = "cached_remotely"
	// FieldExitCode holds the string denoting the exit_code field in the database.
	FieldExitCode = "exit_code"
	// FieldHostname holds the string denoting the hostname field in the database.
	FieldHostname = "hostname"
	// EdgeTestResult holds the string denoting the test_result edge name in mutations.
	EdgeTestResult = "test_result"
	// EdgeTimingBreakdown holds the string denoting the timing_breakdown edge name in mutations.
	EdgeTimingBreakdown = "timing_breakdown"
	// EdgeResourceUsage holds the string denoting the resource_usage edge name in mutations.
	EdgeResourceUsage = "resource_usage"
	// Table holds the table name of the exectioninfo in the database.
	Table = "exection_infos"
	// TestResultTable is the table that holds the test_result relation/edge.
	TestResultTable = "exection_infos"
	// TestResultInverseTable is the table name for the TestResultBES entity.
	// It exists in this package in order to avoid circular dependency with the "testresultbes" package.
	TestResultInverseTable = "test_result_be_ss"
	// TestResultColumn is the table column denoting the test_result relation/edge.
	TestResultColumn = "test_result_bes_execution_info"
	// TimingBreakdownTable is the table that holds the timing_breakdown relation/edge.
	TimingBreakdownTable = "timing_breakdowns"
	// TimingBreakdownInverseTable is the table name for the TimingBreakdown entity.
	// It exists in this package in order to avoid circular dependency with the "timingbreakdown" package.
	TimingBreakdownInverseTable = "timing_breakdowns"
	// TimingBreakdownColumn is the table column denoting the timing_breakdown relation/edge.
	TimingBreakdownColumn = "exection_info_timing_breakdown"
	// ResourceUsageTable is the table that holds the resource_usage relation/edge.
	ResourceUsageTable = "resource_usages"
	// ResourceUsageInverseTable is the table name for the ResourceUsage entity.
	// It exists in this package in order to avoid circular dependency with the "resourceusage" package.
	ResourceUsageInverseTable = "resource_usages"
	// ResourceUsageColumn is the table column denoting the resource_usage relation/edge.
	ResourceUsageColumn = "exection_info_resource_usage"
)

// Columns holds all SQL columns for exectioninfo fields.
var Columns = []string{
	FieldID,
	FieldTimeoutSeconds,
	FieldStrategy,
	FieldCachedRemotely,
	FieldExitCode,
	FieldHostname,
}

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

// 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 ExectionInfo 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()
}

// ByTimeoutSeconds orders the results by the timeout_seconds field.
func ByTimeoutSeconds(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTimeoutSeconds, opts...).ToFunc()
}

// ByStrategy orders the results by the strategy field.
func ByStrategy(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldStrategy, opts...).ToFunc()
}

// ByCachedRemotely orders the results by the cached_remotely field.
func ByCachedRemotely(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldCachedRemotely, opts...).ToFunc()
}

// ByExitCode orders the results by the exit_code field.
func ByExitCode(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldExitCode, opts...).ToFunc()
}

// ByHostname orders the results by the hostname field.
func ByHostname(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldHostname, opts...).ToFunc()
}

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

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

// ByResourceUsageCount orders the results by resource_usage count.
func ByResourceUsageCount(opts ...sql.OrderTermOption) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborsCount(s, newResourceUsageStep(), opts...)
	}
}

// ByResourceUsage orders the results by resource_usage terms.
func ByResourceUsage(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborTerms(s, newResourceUsageStep(), append([]sql.OrderTerm{term}, terms...)...)
	}
}
func newTestResultStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(TestResultInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.O2O, true, TestResultTable, TestResultColumn),
	)
}
func newTimingBreakdownStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(TimingBreakdownInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.O2O, false, TimingBreakdownTable, TimingBreakdownColumn),
	)
}
func newResourceUsageStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(ResourceUsageInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.O2M, false, ResourceUsageTable, ResourceUsageColumn),
	)
}
