| // Code generated by ent, DO NOT EDIT. | |
| package example2 | |
| import ( | |
| "time" | |
| "entgo.io/ent/dialect/sql" | |
| ) | |
| const ( | |
| // Label holds the string label denoting the example2 type in the database. | |
| Label = "example2" | |
| // 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" | |
| // FieldExampleValue2 holds the string denoting the example_value_2 field in the database. | |
| FieldExampleValue2 = "example_value_2" | |
| // Table holds the table name of the example2 in the database. | |
| Table = "example2s" | |
| ) | |
| // Columns holds all SQL columns for example2 fields. | |
| var Columns = []string{ | |
| FieldID, | |
| FieldCreatedAt, | |
| FieldUpdatedAt, | |
| FieldDeletedAt, | |
| FieldExampleValue2, | |
| } | |
| // 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 | |
| ) | |
| // OrderOption defines the ordering options for the Example2 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() | |
| } | |
| // ByExampleValue2 orders the results by the example_value_2 field. | |
| func ByExampleValue2(opts ...sql.OrderTermOption) OrderOption { | |
| return sql.OrderByField(FieldExampleValue2, opts...).ToFunc() | |
| } | |