// Code generated by ent, DO NOT EDIT.

package oauthprovider

import (
	"time"

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

const (
	// Label holds the string label denoting the oauthprovider type in the database.
	Label = "oauth_provider"
	// 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"
	// FieldDeletedAt holds the string denoting the deleted_at field in the database.
	FieldDeletedAt = "deleted_at"
	// FieldName holds the string denoting the name field in the database.
	FieldName = "name"
	// FieldClientID holds the string denoting the client_id field in the database.
	FieldClientID = "client_id"
	// FieldClientSecret holds the string denoting the client_secret field in the database.
	FieldClientSecret = "client_secret"
	// FieldRedirectURL holds the string denoting the redirect_url field in the database.
	FieldRedirectURL = "redirect_url"
	// FieldScopes holds the string denoting the scopes field in the database.
	FieldScopes = "scopes"
	// FieldAuthURL holds the string denoting the auth_url field in the database.
	FieldAuthURL = "auth_url"
	// FieldTokenURL holds the string denoting the token_url field in the database.
	FieldTokenURL = "token_url"
	// FieldInfoURL holds the string denoting the info_url field in the database.
	FieldInfoURL = "info_url"
	// FieldDescription holds the string denoting the description field in the database.
	FieldDescription = "description"
	// FieldSystem holds the string denoting the system field in the database.
	FieldSystem = "system"
	// FieldInit holds the string denoting the init field in the database.
	FieldInit = "init"
	// Table holds the table name of the oauthprovider in the database.
	Table = "sys_oauth_provider"
)

// Columns holds all SQL columns for oauthprovider fields.
var Columns = []string{
	FieldID,
	FieldCreatedAt,
	FieldUpdatedAt,
	FieldDeletedAt,
	FieldName,
	FieldClientID,
	FieldClientSecret,
	FieldRedirectURL,
	FieldScopes,
	FieldAuthURL,
	FieldTokenURL,
	FieldInfoURL,
	FieldDescription,
	FieldSystem,
	FieldInit,
}

// 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
	// DefaultRedirectURL holds the default value on creation for the "redirect_url" field.
	DefaultRedirectURL string
	// DefaultScopes holds the default value on creation for the "scopes" field.
	DefaultScopes string
	// DefaultAuthURL holds the default value on creation for the "auth_url" field.
	DefaultAuthURL string
	// DefaultTokenURL holds the default value on creation for the "token_url" field.
	DefaultTokenURL string
	// DefaultInfoURL holds the default value on creation for the "info_url" field.
	DefaultInfoURL string
	// DefaultDescription holds the default value on creation for the "description" field.
	DefaultDescription string
	// DefaultSystem holds the default value on creation for the "system" field.
	DefaultSystem bool
	// DefaultInit holds the default value on creation for the "init" field.
	DefaultInit bool
	// DefaultID holds the default value on creation for the "id" field.
	DefaultID func() int64
)

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

// ByDeletedAt orders the results by the deleted_at field.
func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
}

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

// ByClientID orders the results by the client_id field.
func ByClientID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldClientID, opts...).ToFunc()
}

// ByClientSecret orders the results by the client_secret field.
func ByClientSecret(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldClientSecret, opts...).ToFunc()
}

// ByRedirectURL orders the results by the redirect_url field.
func ByRedirectURL(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldRedirectURL, opts...).ToFunc()
}

// ByScopes orders the results by the scopes field.
func ByScopes(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldScopes, opts...).ToFunc()
}

// ByAuthURL orders the results by the auth_url field.
func ByAuthURL(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldAuthURL, opts...).ToFunc()
}

// ByTokenURL orders the results by the token_url field.
func ByTokenURL(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTokenURL, opts...).ToFunc()
}

// ByInfoURL orders the results by the info_url field.
func ByInfoURL(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldInfoURL, opts...).ToFunc()
}

// ByDescription orders the results by the description field.
func ByDescription(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldDescription, opts...).ToFunc()
}

// BySystem orders the results by the system field.
func BySystem(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldSystem, opts...).ToFunc()
}

// ByInit orders the results by the init field.
func ByInit(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldInit, opts...).ToFunc()
}
