// Code generated by ent, DO NOT EDIT. package timestamp import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "github.com/google/uuid" ) const ( // Label holds the string label denoting the timestamp type in the database. Label = "timestamp" // FieldID holds the string denoting the id field in the database. FieldID = "id" // FieldType holds the string denoting the type field in the database. FieldType = "type" // FieldTimestamp holds the string denoting the timestamp field in the database. FieldTimestamp = "timestamp" // EdgeSignature holds the string denoting the signature edge name in mutations. EdgeSignature = "signature" // Table holds the table name of the timestamp in the database. Table = "timestamps" // SignatureTable is the table that holds the signature relation/edge. SignatureTable = "timestamps" // SignatureInverseTable is the table name for the Signature entity. // It exists in this package in order to avoid circular dependency with the "signature" package. SignatureInverseTable = "signatures" // SignatureColumn is the table column denoting the signature relation/edge. SignatureColumn = "signature_timestamps" ) // Columns holds all SQL columns for timestamp fields. var Columns = []string{ FieldID, FieldType, FieldTimestamp, } // ForeignKeys holds the SQL foreign-keys that are owned by the "timestamps" // table and are not defined as standalone fields in the schema. var ForeignKeys = []string{ "signature_timestamps", } // 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 ( // DefaultID holds the default value on creation for the "id" field. DefaultID func() uuid.UUID ) // OrderOption defines the ordering options for the Timestamp 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() } // ByType orders the results by the type field. func ByType(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldType, opts...).ToFunc() } // ByTimestamp orders the results by the timestamp field. func ByTimestamp(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldTimestamp, opts...).ToFunc() } // BySignatureField orders the results by signature field. func BySignatureField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newSignatureStep(), sql.OrderByField(field, opts...)) } } func newSignatureStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(SignatureInverseTable, FieldID), sqlgraph.Edge(sqlgraph.M2O, true, SignatureTable, SignatureColumn), ) }