Files

247 lines
9.1 KiB
Go

// Code generated by ent, DO NOT EDIT.
package gitidentity
import (
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the gitidentity type in the database.
Label = "git_identity"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldDeletedAt holds the string denoting the deleted_at field in the database.
FieldDeletedAt = "deleted_at"
// FieldUserID holds the string denoting the user_id field in the database.
FieldUserID = "user_id"
// FieldPlatform holds the string denoting the platform field in the database.
FieldPlatform = "platform"
// FieldBaseURL holds the string denoting the base_url field in the database.
FieldBaseURL = "base_url"
// FieldAccessToken holds the string denoting the access_token field in the database.
FieldAccessToken = "access_token"
// FieldUsername holds the string denoting the username field in the database.
FieldUsername = "username"
// FieldEmail holds the string denoting the email field in the database.
FieldEmail = "email"
// FieldInstallationID holds the string denoting the installation_id field in the database.
FieldInstallationID = "installation_id"
// FieldRemark holds the string denoting the remark field in the database.
FieldRemark = "remark"
// FieldOauthRefreshToken holds the string denoting the oauth_refresh_token field in the database.
FieldOauthRefreshToken = "oauth_refresh_token"
// FieldOauthExpiresAt holds the string denoting the oauth_expires_at field in the database.
FieldOauthExpiresAt = "oauth_expires_at"
// 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"
// EdgeUser holds the string denoting the user edge name in mutations.
EdgeUser = "user"
// EdgeProjects holds the string denoting the projects edge name in mutations.
EdgeProjects = "projects"
// EdgeProjectTasks holds the string denoting the project_tasks edge name in mutations.
EdgeProjectTasks = "project_tasks"
// Table holds the table name of the gitidentity in the database.
Table = "git_identities"
// UserTable is the table that holds the user relation/edge.
UserTable = "git_identities"
// 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"
// ProjectsTable is the table that holds the projects relation/edge.
ProjectsTable = "projects"
// ProjectsInverseTable is the table name for the Project entity.
// It exists in this package in order to avoid circular dependency with the "project" package.
ProjectsInverseTable = "projects"
// ProjectsColumn is the table column denoting the projects relation/edge.
ProjectsColumn = "git_identity_id"
// ProjectTasksTable is the table that holds the project_tasks relation/edge.
ProjectTasksTable = "project_tasks"
// ProjectTasksInverseTable is the table name for the ProjectTask entity.
// It exists in this package in order to avoid circular dependency with the "projecttask" package.
ProjectTasksInverseTable = "project_tasks"
// ProjectTasksColumn is the table column denoting the project_tasks relation/edge.
ProjectTasksColumn = "git_identity_id"
)
// Columns holds all SQL columns for gitidentity fields.
var Columns = []string{
FieldID,
FieldDeletedAt,
FieldUserID,
FieldPlatform,
FieldBaseURL,
FieldAccessToken,
FieldUsername,
FieldEmail,
FieldInstallationID,
FieldRemark,
FieldOauthRefreshToken,
FieldOauthExpiresAt,
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
}
// Note that the variables below are initialized by the runtime
// package on the initialization of the application. Therefore,
// it should be imported in the main as follows:
//
// import _ "github.com/chaitin/MonkeyCode/backend/db/runtime"
var (
Hooks [1]ent.Hook
Interceptors [1]ent.Interceptor
// 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 GitIdentity 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()
}
// ByDeletedAt orders the results by the deleted_at field.
func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
}
// ByUserID orders the results by the user_id field.
func ByUserID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUserID, opts...).ToFunc()
}
// ByPlatform orders the results by the platform field.
func ByPlatform(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldPlatform, opts...).ToFunc()
}
// ByBaseURL orders the results by the base_url field.
func ByBaseURL(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldBaseURL, opts...).ToFunc()
}
// ByAccessToken orders the results by the access_token field.
func ByAccessToken(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAccessToken, opts...).ToFunc()
}
// ByUsername orders the results by the username field.
func ByUsername(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUsername, opts...).ToFunc()
}
// ByEmail orders the results by the email field.
func ByEmail(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEmail, opts...).ToFunc()
}
// ByInstallationID orders the results by the installation_id field.
func ByInstallationID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldInstallationID, opts...).ToFunc()
}
// ByRemark orders the results by the remark field.
func ByRemark(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRemark, opts...).ToFunc()
}
// ByOauthRefreshToken orders the results by the oauth_refresh_token field.
func ByOauthRefreshToken(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOauthRefreshToken, opts...).ToFunc()
}
// ByOauthExpiresAt orders the results by the oauth_expires_at field.
func ByOauthExpiresAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOauthExpiresAt, 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()
}
// 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...))
}
}
// ByProjectsCount orders the results by projects count.
func ByProjectsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newProjectsStep(), opts...)
}
}
// ByProjects orders the results by projects terms.
func ByProjects(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newProjectsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByProjectTasksCount orders the results by project_tasks count.
func ByProjectTasksCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newProjectTasksStep(), opts...)
}
}
// ByProjectTasks orders the results by project_tasks terms.
func ByProjectTasks(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newProjectTasksStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
func newUserStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(UserInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn),
)
}
func newProjectsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(ProjectsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, ProjectsTable, ProjectsColumn),
)
}
func newProjectTasksStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(ProjectTasksInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, ProjectTasksTable, ProjectTasksColumn),
)
}