// Code generated by ent, DO NOT EDIT.

package visitorstat

import (
	"time"

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

const (
	// Label holds the string label denoting the visitorstat type in the database.
	Label = "visitor_stat"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// FieldUpdatedAt holds the string denoting the updated_at field in the database.
	FieldUpdatedAt = "updated_at"
	// FieldDate holds the string denoting the date field in the database.
	FieldDate = "date"
	// FieldUniqueVisitors holds the string denoting the unique_visitors field in the database.
	FieldUniqueVisitors = "unique_visitors"
	// FieldTotalViews holds the string denoting the total_views field in the database.
	FieldTotalViews = "total_views"
	// FieldPageViews holds the string denoting the page_views field in the database.
	FieldPageViews = "page_views"
	// FieldBounceCount holds the string denoting the bounce_count field in the database.
	FieldBounceCount = "bounce_count"
	// Table holds the table name of the visitorstat in the database.
	Table = "visitor_stats"
)

// Columns holds all SQL columns for visitorstat fields.
var Columns = []string{
	FieldID,
	FieldCreatedAt,
	FieldUpdatedAt,
	FieldDate,
	FieldUniqueVisitors,
	FieldTotalViews,
	FieldPageViews,
	FieldBounceCount,
}

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

var (
	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
	DefaultCreatedAt func() time.Time
	// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
	DefaultUpdatedAt func() time.Time
	// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
	UpdateDefaultUpdatedAt func() time.Time
	// DefaultUniqueVisitors holds the default value on creation for the "unique_visitors" field.
	DefaultUniqueVisitors int64
	// DefaultTotalViews holds the default value on creation for the "total_views" field.
	DefaultTotalViews int64
	// DefaultPageViews holds the default value on creation for the "page_views" field.
	DefaultPageViews int64
	// DefaultBounceCount holds the default value on creation for the "bounce_count" field.
	DefaultBounceCount int64
)

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

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

// ByUpdatedAt orders the results by the updated_at field.
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
}

// ByDate orders the results by the date field.
func ByDate(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldDate, opts...).ToFunc()
}

// ByUniqueVisitors orders the results by the unique_visitors field.
func ByUniqueVisitors(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldUniqueVisitors, opts...).ToFunc()
}

// ByTotalViews orders the results by the total_views field.
func ByTotalViews(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTotalViews, opts...).ToFunc()
}

// ByPageViews orders the results by the page_views field.
func ByPageViews(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldPageViews, opts...).ToFunc()
}

// ByBounceCount orders the results by the bounce_count field.
func ByBounceCount(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldBounceCount, opts...).ToFunc()
}
