Files
MonkeyCode/backend/db/agentpluginversion/agentpluginversion.go

113 lines
3.8 KiB
Go

// Code generated by ent, DO NOT EDIT.
package agentpluginversion
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 agentpluginversion type in the database.
Label = "agent_plugin_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"
// EdgePlugin holds the string denoting the plugin edge name in mutations.
EdgePlugin = "plugin"
// Table holds the table name of the agentpluginversion in the database.
Table = "agent_plugin_versions"
// PluginTable is the table that holds the plugin relation/edge.
PluginTable = "agent_plugin_versions"
// PluginInverseTable is the table name for the AgentPlugin entity.
// It exists in this package in order to avoid circular dependency with the "agentplugin" package.
PluginInverseTable = "agent_plugins"
// PluginColumn is the table column denoting the plugin relation/edge.
PluginColumn = "resource_id"
)
// Columns holds all SQL columns for agentpluginversion 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 AgentPluginVersion 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()
}
// ByPluginField orders the results by plugin field.
func ByPluginField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newPluginStep(), sql.OrderByField(field, opts...))
}
}
func newPluginStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(PluginInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, PluginTable, PluginColumn),
)
}