// Code generated by ent, DO NOT EDIT.

package visitorlog

import (
	"time"

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

const (
	// Label holds the string label denoting the visitorlog type in the database.
	Label = "visitor_log"
	// 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"
	// FieldVisitorID holds the string denoting the visitor_id field in the database.
	FieldVisitorID = "visitor_id"
	// FieldSessionID holds the string denoting the session_id field in the database.
	FieldSessionID = "session_id"
	// FieldIPAddress holds the string denoting the ip_address field in the database.
	FieldIPAddress = "ip_address"
	// FieldUserAgent holds the string denoting the user_agent field in the database.
	FieldUserAgent = "user_agent"
	// FieldReferer holds the string denoting the referer field in the database.
	FieldReferer = "referer"
	// FieldURLPath holds the string denoting the url_path field in the database.
	FieldURLPath = "url_path"
	// FieldCountry holds the string denoting the country field in the database.
	FieldCountry = "country"
	// FieldRegion holds the string denoting the region field in the database.
	FieldRegion = "region"
	// FieldCity holds the string denoting the city field in the database.
	FieldCity = "city"
	// FieldBrowser holds the string denoting the browser field in the database.
	FieldBrowser = "browser"
	// FieldOs holds the string denoting the os field in the database.
	FieldOs = "os"
	// FieldDevice holds the string denoting the device field in the database.
	FieldDevice = "device"
	// FieldDuration holds the string denoting the duration field in the database.
	FieldDuration = "duration"
	// FieldIsBounce holds the string denoting the is_bounce field in the database.
	FieldIsBounce = "is_bounce"
	// Table holds the table name of the visitorlog in the database.
	Table = "visitor_logs"
)

// Columns holds all SQL columns for visitorlog fields.
var Columns = []string{
	FieldID,
	FieldCreatedAt,
	FieldVisitorID,
	FieldSessionID,
	FieldIPAddress,
	FieldUserAgent,
	FieldReferer,
	FieldURLPath,
	FieldCountry,
	FieldRegion,
	FieldCity,
	FieldBrowser,
	FieldOs,
	FieldDevice,
	FieldDuration,
	FieldIsBounce,
}

// 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
	// VisitorIDValidator is a validator for the "visitor_id" field. It is called by the builders before save.
	VisitorIDValidator func(string) error
	// SessionIDValidator is a validator for the "session_id" field. It is called by the builders before save.
	SessionIDValidator func(string) error
	// IPAddressValidator is a validator for the "ip_address" field. It is called by the builders before save.
	IPAddressValidator func(string) error
	// UserAgentValidator is a validator for the "user_agent" field. It is called by the builders before save.
	UserAgentValidator func(string) error
	// RefererValidator is a validator for the "referer" field. It is called by the builders before save.
	RefererValidator func(string) error
	// URLPathValidator is a validator for the "url_path" field. It is called by the builders before save.
	URLPathValidator func(string) error
	// CountryValidator is a validator for the "country" field. It is called by the builders before save.
	CountryValidator func(string) error
	// RegionValidator is a validator for the "region" field. It is called by the builders before save.
	RegionValidator func(string) error
	// CityValidator is a validator for the "city" field. It is called by the builders before save.
	CityValidator func(string) error
	// BrowserValidator is a validator for the "browser" field. It is called by the builders before save.
	BrowserValidator func(string) error
	// OsValidator is a validator for the "os" field. It is called by the builders before save.
	OsValidator func(string) error
	// DeviceValidator is a validator for the "device" field. It is called by the builders before save.
	DeviceValidator func(string) error
	// DefaultDuration holds the default value on creation for the "duration" field.
	DefaultDuration int
	// DefaultIsBounce holds the default value on creation for the "is_bounce" field.
	DefaultIsBounce bool
)

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

// ByVisitorID orders the results by the visitor_id field.
func ByVisitorID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldVisitorID, opts...).ToFunc()
}

// BySessionID orders the results by the session_id field.
func BySessionID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldSessionID, opts...).ToFunc()
}

// ByIPAddress orders the results by the ip_address field.
func ByIPAddress(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldIPAddress, opts...).ToFunc()
}

// ByUserAgent orders the results by the user_agent field.
func ByUserAgent(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldUserAgent, opts...).ToFunc()
}

// ByReferer orders the results by the referer field.
func ByReferer(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldReferer, opts...).ToFunc()
}

// ByURLPath orders the results by the url_path field.
func ByURLPath(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldURLPath, opts...).ToFunc()
}

// ByCountry orders the results by the country field.
func ByCountry(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldCountry, opts...).ToFunc()
}

// ByRegion orders the results by the region field.
func ByRegion(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldRegion, opts...).ToFunc()
}

// ByCity orders the results by the city field.
func ByCity(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldCity, opts...).ToFunc()
}

// ByBrowser orders the results by the browser field.
func ByBrowser(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldBrowser, opts...).ToFunc()
}

// ByOs orders the results by the os field.
func ByOs(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldOs, opts...).ToFunc()
}

// ByDevice orders the results by the device field.
func ByDevice(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldDevice, opts...).ToFunc()
}

// ByDuration orders the results by the duration field.
func ByDuration(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldDuration, opts...).ToFunc()
}

// ByIsBounce orders the results by the is_bounce field.
func ByIsBounce(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldIsBounce, opts...).ToFunc()
}
