mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-11-24 05:02:20 +08:00
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
113 lines
3.8 KiB
Go
113 lines
3.8 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package agentskillversion
|
|
|
|
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 agentskillversion type in the database.
|
|
Label = "agent_skill_version"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldResourceID holds the string denoting the resource_id field in the database.
|
|
FieldResourceID = "resource_id"
|
|
// FieldVersion holds the string denoting the version field in the database.
|
|
FieldVersion = "version"
|
|
// FieldS3Key holds the string denoting the s3_key field in the database.
|
|
FieldS3Key = "s3_key"
|
|
// FieldParsedMeta holds the string denoting the parsed_meta field in the database.
|
|
FieldParsedMeta = "parsed_meta"
|
|
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
|
FieldCreatedAt = "created_at"
|
|
// EdgeSkill holds the string denoting the skill edge name in mutations.
|
|
EdgeSkill = "skill"
|
|
// Table holds the table name of the agentskillversion in the database.
|
|
Table = "agent_skill_versions"
|
|
// SkillTable is the table that holds the skill relation/edge.
|
|
SkillTable = "agent_skill_versions"
|
|
// SkillInverseTable is the table name for the AgentSkill entity.
|
|
// It exists in this package in order to avoid circular dependency with the "agentskill" package.
|
|
SkillInverseTable = "agent_skills"
|
|
// SkillColumn is the table column denoting the skill relation/edge.
|
|
SkillColumn = "resource_id"
|
|
)
|
|
|
|
// Columns holds all SQL columns for agentskillversion fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldResourceID,
|
|
FieldVersion,
|
|
FieldS3Key,
|
|
FieldParsedMeta,
|
|
FieldCreatedAt,
|
|
}
|
|
|
|
// 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 (
|
|
// VersionValidator is a validator for the "version" field. It is called by the builders before save.
|
|
VersionValidator func(string) error
|
|
// S3KeyValidator is a validator for the "s3_key" field. It is called by the builders before save.
|
|
S3KeyValidator func(string) error
|
|
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
|
DefaultCreatedAt 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 AgentSkillVersion 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()
|
|
}
|
|
|
|
// ByResourceID orders the results by the resource_id field.
|
|
func ByResourceID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldResourceID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByVersion orders the results by the version field.
|
|
func ByVersion(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldVersion, opts...).ToFunc()
|
|
}
|
|
|
|
// ByS3Key orders the results by the s3_key field.
|
|
func ByS3Key(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldS3Key, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCreatedAt orders the results by the created_at field.
|
|
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// BySkillField orders the results by skill field.
|
|
func BySkillField(field string, opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newSkillStep(), sql.OrderByField(field, opts...))
|
|
}
|
|
}
|
|
func newSkillStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(SkillInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2O, true, SkillTable, SkillColumn),
|
|
)
|
|
}
|