// Code generated by ent, DO NOT EDIT.

package docserverapp

import (
	"time"

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

const (
	// Label holds the string label denoting the docserverapp type in the database.
	Label = "doc_server_app"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldApplication holds the string denoting the application field in the database.
	FieldApplication = "application"
	// FieldName holds the string denoting the name field in the database.
	FieldName = "name"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// Table holds the table name of the docserverapp in the database.
	Table = "doc_server_app"
)

// Columns holds all SQL columns for docserverapp fields.
var Columns = []string{
	FieldID,
	FieldApplication,
	FieldName,
	FieldCreatedAt,
}

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

// Note that the variables below are initialized by the runtime
// package on the initialization of the application. Therefore,
// it should be imported in the main as follows:
//
//	import _ "convert-server/domain/entity/serversitemicros/runtime"
var (
	Hooks [2]ent.Hook
	// DefaultName holds the default value on creation for the "name" field.
	DefaultName string
	// UpdateDefaultCreatedAt holds the default value on update for the "created_at" field.
	UpdateDefaultCreatedAt func() time.Time
)

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

// ByApplication orders the results by the application field.
func ByApplication(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldApplication, opts...).ToFunc()
}

// ByName orders the results by the name field.
func ByName(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldName, opts...).ToFunc()
}

// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}
