// Code generated by ent, DO NOT EDIT. package attestationpolicy import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "github.com/google/uuid" ) const ( // Label holds the string label denoting the attestationpolicy type in the database. Label = "attestation_policy" // 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" // EdgeStatement holds the string denoting the statement edge name in mutations. EdgeStatement = "statement" // Table holds the table name of the attestationpolicy in the database. Table = "attestation_policies" // StatementTable is the table that holds the statement relation/edge. StatementTable = "attestation_policies" // StatementInverseTable is the table name for the Statement entity. // It exists in this package in order to avoid circular dependency with the "statement" package. StatementInverseTable = "statements" // StatementColumn is the table column denoting the statement relation/edge. StatementColumn = "statement_policy" ) // Columns holds all SQL columns for attestationpolicy fields. var Columns = []string{ FieldID, FieldName, } // ForeignKeys holds the SQL foreign-keys that are owned by the "attestation_policies" // table and are not defined as standalone fields in the schema. var ForeignKeys = []string{ "statement_policy", } // 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 } } for i := range ForeignKeys { if column == ForeignKeys[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 // DefaultID holds the default value on creation for the "id" field. DefaultID func() uuid.UUID ) // OrderOption defines the ordering options for the AttestationPolicy 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() } // ByStatementField orders the results by statement field. func ByStatementField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newStatementStep(), sql.OrderByField(field, opts...)) } } func newStatementStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(StatementInverseTable, FieldID), sqlgraph.Edge(sqlgraph.O2O, true, StatementTable, StatementColumn), ) }