mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-02-02 06:43:23 +08:00
115 lines
3.8 KiB
Go
115 lines
3.8 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package taskrecord
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the taskrecord type in the database.
|
|
Label = "task_record"
|
|
// 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"
|
|
// FieldCompletion holds the string denoting the completion field in the database.
|
|
FieldCompletion = "completion"
|
|
// FieldOutputTokens holds the string denoting the output_tokens field in the database.
|
|
FieldOutputTokens = "output_tokens"
|
|
// 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"
|
|
// Table holds the table name of the taskrecord in the database.
|
|
Table = "task_records"
|
|
// TaskTable is the table that holds the task relation/edge.
|
|
TaskTable = "task_records"
|
|
// 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"
|
|
)
|
|
|
|
// Columns holds all SQL columns for taskrecord fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldTaskID,
|
|
FieldCompletion,
|
|
FieldOutputTokens,
|
|
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 (
|
|
// 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 TaskRecord 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()
|
|
}
|
|
|
|
// ByCompletion orders the results by the completion field.
|
|
func ByCompletion(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCompletion, opts...).ToFunc()
|
|
}
|
|
|
|
// ByOutputTokens orders the results by the output_tokens field.
|
|
func ByOutputTokens(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldOutputTokens, 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...))
|
|
}
|
|
}
|
|
func newTaskStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(TaskInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2O, true, TaskTable, TaskColumn),
|
|
)
|
|
}
|