// Code generated by ent, DO NOT EDIT. package taskmodelswitch 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 taskmodelswitch type in the database. Label = "task_model_switch" // FieldID holds the string denoting the id field in the database. FieldID = "id" // FieldTaskID holds the string denoting the task_id field in the database. FieldTaskID = "task_id" // FieldUserID holds the string denoting the user_id field in the database. FieldUserID = "user_id" // FieldFromModelID holds the string denoting the from_model_id field in the database. FieldFromModelID = "from_model_id" // FieldToModelID holds the string denoting the to_model_id field in the database. FieldToModelID = "to_model_id" // FieldRequestID holds the string denoting the request_id field in the database. FieldRequestID = "request_id" // FieldLoadSession holds the string denoting the load_session field in the database. FieldLoadSession = "load_session" // FieldSuccess holds the string denoting the success field in the database. FieldSuccess = "success" // FieldMessage holds the string denoting the message field in the database. FieldMessage = "message" // FieldSessionID holds the string denoting the session_id field in the database. FieldSessionID = "session_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" // EdgeTask holds the string denoting the task edge name in mutations. EdgeTask = "task" // EdgeUser holds the string denoting the user edge name in mutations. EdgeUser = "user" // EdgeFromModel holds the string denoting the from_model edge name in mutations. EdgeFromModel = "from_model" // EdgeToModel holds the string denoting the to_model edge name in mutations. EdgeToModel = "to_model" // Table holds the table name of the taskmodelswitch in the database. Table = "task_model_switches" // TaskTable is the table that holds the task relation/edge. TaskTable = "task_model_switches" // TaskInverseTable is the table name for the Task entity. // It exists in this package in order to avoid circular dependency with the "task" package. TaskInverseTable = "tasks" // TaskColumn is the table column denoting the task relation/edge. TaskColumn = "task_id" // UserTable is the table that holds the user relation/edge. UserTable = "task_model_switches" // UserInverseTable is the table name for the User entity. // It exists in this package in order to avoid circular dependency with the "user" package. UserInverseTable = "users" // UserColumn is the table column denoting the user relation/edge. UserColumn = "user_id" // FromModelTable is the table that holds the from_model relation/edge. FromModelTable = "task_model_switches" // FromModelInverseTable is the table name for the Model entity. // It exists in this package in order to avoid circular dependency with the "model" package. FromModelInverseTable = "models" // FromModelColumn is the table column denoting the from_model relation/edge. FromModelColumn = "from_model_id" // ToModelTable is the table that holds the to_model relation/edge. ToModelTable = "task_model_switches" // ToModelInverseTable is the table name for the Model entity. // It exists in this package in order to avoid circular dependency with the "model" package. ToModelInverseTable = "models" // ToModelColumn is the table column denoting the to_model relation/edge. ToModelColumn = "to_model_id" ) // Columns holds all SQL columns for taskmodelswitch fields. var Columns = []string{ FieldID, FieldTaskID, FieldUserID, FieldFromModelID, FieldToModelID, FieldRequestID, FieldLoadSession, FieldSuccess, FieldMessage, FieldSessionID, FieldCreatedAt, FieldUpdatedAt, } // 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 ( // DefaultRequestID holds the default value on creation for the "request_id" field. DefaultRequestID string // DefaultLoadSession holds the default value on creation for the "load_session" field. DefaultLoadSession bool // DefaultMessage holds the default value on creation for the "message" field. DefaultMessage string // DefaultSessionID holds the default value on creation for the "session_id" field. DefaultSessionID string // 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 // DefaultID holds the default value on creation for the "id" field. DefaultID func() uuid.UUID ) // OrderOption defines the ordering options for the TaskModelSwitch 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() } // ByTaskID orders the results by the task_id field. func ByTaskID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldTaskID, opts...).ToFunc() } // ByUserID orders the results by the user_id field. func ByUserID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldUserID, opts...).ToFunc() } // ByFromModelID orders the results by the from_model_id field. func ByFromModelID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldFromModelID, opts...).ToFunc() } // ByToModelID orders the results by the to_model_id field. func ByToModelID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldToModelID, opts...).ToFunc() } // ByRequestID orders the results by the request_id field. func ByRequestID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldRequestID, opts...).ToFunc() } // ByLoadSession orders the results by the load_session field. func ByLoadSession(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldLoadSession, opts...).ToFunc() } // BySuccess orders the results by the success field. func BySuccess(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldSuccess, opts...).ToFunc() } // ByMessage orders the results by the message field. func ByMessage(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldMessage, opts...).ToFunc() } // BySessionID orders the results by the session_id field. func BySessionID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldSessionID, 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() } // ByTaskField orders the results by task field. func ByTaskField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newTaskStep(), sql.OrderByField(field, opts...)) } } // ByUserField orders the results by user field. func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newUserStep(), sql.OrderByField(field, opts...)) } } // ByFromModelField orders the results by from_model field. func ByFromModelField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newFromModelStep(), sql.OrderByField(field, opts...)) } } // ByToModelField orders the results by to_model field. func ByToModelField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newToModelStep(), sql.OrderByField(field, opts...)) } } func newTaskStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(TaskInverseTable, FieldID), sqlgraph.Edge(sqlgraph.M2O, true, TaskTable, TaskColumn), ) } func newUserStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(UserInverseTable, FieldID), sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn), ) } func newFromModelStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(FromModelInverseTable, FieldID), sqlgraph.Edge(sqlgraph.M2O, true, FromModelTable, FromModelColumn), ) } func newToModelStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(ToModelInverseTable, FieldID), sqlgraph.Edge(sqlgraph.M2O, true, ToModelTable, ToModelColumn), ) }