// Code generated by ent, DO NOT EDIT.

package edge

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

const (
	// Label holds the string label denoting the edge type in the database.
	Label = "edge"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldSource holds the string denoting the source field in the database.
	FieldSource = "source"
	// FieldTarget holds the string denoting the target field in the database.
	FieldTarget = "target"
	// FieldRelation holds the string denoting the relation field in the database.
	FieldRelation = "relation"
	// Table holds the table name of the edge in the database.
	Table = "edges"
)

// Columns holds all SQL columns for edge fields.
var Columns = []string{
	FieldID,
	FieldSource,
	FieldTarget,
	FieldRelation,
}

// 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
		}
	}
	return false
}

// OrderOption defines the ordering options for the Edge 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()
}

// BySource orders the results by the source field.
func BySource(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldSource, opts...).ToFunc()
}

// ByTarget orders the results by the target field.
func ByTarget(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTarget, opts...).ToFunc()
}

// ByRelation orders the results by the relation field.
func ByRelation(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldRelation, opts...).ToFunc()
}
