pcmt/ent/localbreach/localbreach.go

188 lines
6.9 KiB
Go
Raw Normal View History

// Code generated by ent, DO NOT EDIT.
package localbreach
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"github.com/google/uuid"
)
const (
// Label holds the string label denoting the localbreach type in the database.
Label = "local_breach"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// FieldDate holds the string denoting the date field in the database.
FieldDate = "date"
// FieldDescription holds the string denoting the description field in the database.
FieldDescription = "description"
// FieldIsVerified holds the string denoting the is_verified field in the database.
FieldIsVerified = "is_verified"
// FieldContainsPasswords holds the string denoting the contains_passwords field in the database.
FieldContainsPasswords = "contains_passwords"
// FieldContainsHashes holds the string denoting the contains_hashes field in the database.
FieldContainsHashes = "contains_hashes"
// FieldContainsEmails holds the string denoting the contains_emails field in the database.
FieldContainsEmails = "contains_emails"
// FieldContainsUsernames holds the string denoting the contains_usernames field in the database.
FieldContainsUsernames = "contains_usernames"
// FieldHashType holds the string denoting the hash_type field in the database.
FieldHashType = "hash_type"
// FieldHashSalted holds the string denoting the hash_salted field in the database.
FieldHashSalted = "hash_salted"
// FieldHashPeppered holds the string denoting the hash_peppered field in the database.
FieldHashPeppered = "hash_peppered"
// FieldData holds the string denoting the data field in the database.
FieldData = "data"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// EdgeTrackedBreaches holds the string denoting the tracked_breaches edge name in mutations.
EdgeTrackedBreaches = "tracked_breaches"
// Table holds the table name of the localbreach in the database.
Table = "local_breaches"
// TrackedBreachesTable is the table that holds the tracked_breaches relation/edge. The primary key declared below.
TrackedBreachesTable = "tracked_breaches_localbreach"
// TrackedBreachesInverseTable is the table name for the TrackedBreaches entity.
// It exists in this package in order to avoid circular dependency with the "trackedbreaches" package.
TrackedBreachesInverseTable = "tracked_breaches"
)
// Columns holds all SQL columns for localbreach fields.
var Columns = []string{
FieldID,
FieldName,
FieldDate,
FieldDescription,
FieldIsVerified,
FieldContainsPasswords,
FieldContainsHashes,
FieldContainsEmails,
FieldContainsUsernames,
FieldHashType,
FieldHashSalted,
FieldHashPeppered,
FieldData,
FieldCreatedAt,
}
var (
// TrackedBreachesPrimaryKey and TrackedBreachesColumn2 are the table columns denoting the
// primary key for the tracked_breaches relation (M2M).
TrackedBreachesPrimaryKey = []string{"tracked_breaches_id", "local_breach_id"}
)
// 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 (
// NameValidator is a validator for the "name" field. It is called by the builders before save.
NameValidator func(string) error
// DefaultDate holds the default value on creation for the "date" field.
DefaultDate time.Time
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt time.Time
// DefaultID holds the default value on creation for the "id" field.
DefaultID func() uuid.UUID
)
// OrderOption defines the ordering options for the LocalBreach 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()
}
// ByName orders the results by the name field.
func ByName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldName, opts...).ToFunc()
}
// ByDate orders the results by the date field.
func ByDate(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDate, opts...).ToFunc()
}
// ByDescription orders the results by the description field.
func ByDescription(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDescription, opts...).ToFunc()
}
// ByIsVerified orders the results by the is_verified field.
func ByIsVerified(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldIsVerified, opts...).ToFunc()
}
// ByContainsPasswords orders the results by the contains_passwords field.
func ByContainsPasswords(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldContainsPasswords, opts...).ToFunc()
}
// ByContainsHashes orders the results by the contains_hashes field.
func ByContainsHashes(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldContainsHashes, opts...).ToFunc()
}
// ByContainsEmails orders the results by the contains_emails field.
func ByContainsEmails(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldContainsEmails, opts...).ToFunc()
}
// ByContainsUsernames orders the results by the contains_usernames field.
func ByContainsUsernames(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldContainsUsernames, opts...).ToFunc()
}
// ByHashType orders the results by the hash_type field.
func ByHashType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldHashType, opts...).ToFunc()
}
// ByHashSalted orders the results by the hash_salted field.
func ByHashSalted(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldHashSalted, opts...).ToFunc()
}
// ByHashPeppered orders the results by the hash_peppered field.
func ByHashPeppered(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldHashPeppered, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}
// ByTrackedBreachesCount orders the results by tracked_breaches count.
func ByTrackedBreachesCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newTrackedBreachesStep(), opts...)
}
}
// ByTrackedBreaches orders the results by tracked_breaches terms.
func ByTrackedBreaches(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newTrackedBreachesStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
func newTrackedBreachesStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(TrackedBreachesInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2M, true, TrackedBreachesTable, TrackedBreachesPrimaryKey...),
)
}