123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- // Code generated by ent, DO NOT EDIT.
- package compapiasynctask
- import (
- "time"
- "entgo.io/ent/dialect/sql"
- )
- const (
- // Label holds the string label denoting the compapiasynctask type in the database.
- Label = "compapi_asynctask"
- // FieldID holds the string denoting the id field in the database.
- FieldID = "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"
- // FieldAuthToken holds the string denoting the auth_token field in the database.
- FieldAuthToken = "auth_token"
- // FieldEventType holds the string denoting the event_type field in the database.
- FieldEventType = "event_type"
- // FieldChatID holds the string denoting the chat_id field in the database.
- FieldChatID = "chat_id"
- // FieldWorkidIdx holds the string denoting the workid_idx field in the database.
- FieldWorkidIdx = "workid_idx"
- // FieldOpenaiBase holds the string denoting the openai_base field in the database.
- FieldOpenaiBase = "openai_base"
- // FieldOpenaiKey holds the string denoting the openai_key field in the database.
- FieldOpenaiKey = "openai_key"
- // FieldRequestRaw holds the string denoting the request_raw field in the database.
- FieldRequestRaw = "request_raw"
- // FieldResponseRaw holds the string denoting the response_raw field in the database.
- FieldResponseRaw = "response_raw"
- // FieldCallbackURL holds the string denoting the callback_url field in the database.
- FieldCallbackURL = "callback_url"
- // FieldTaskStatus holds the string denoting the task_status field in the database.
- FieldTaskStatus = "task_status"
- // FieldRetryCount holds the string denoting the retry_count field in the database.
- FieldRetryCount = "retry_count"
- // FieldLastError holds the string denoting the last_error field in the database.
- FieldLastError = "last_error"
- // Table holds the table name of the compapiasynctask in the database.
- Table = "compapi_asynctask"
- )
- // Columns holds all SQL columns for compapiasynctask fields.
- var Columns = []string{
- FieldID,
- FieldCreatedAt,
- FieldUpdatedAt,
- FieldAuthToken,
- FieldEventType,
- FieldChatID,
- FieldWorkidIdx,
- FieldOpenaiBase,
- FieldOpenaiKey,
- FieldRequestRaw,
- FieldResponseRaw,
- FieldCallbackURL,
- FieldTaskStatus,
- FieldRetryCount,
- FieldLastError,
- }
- // 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
- // DefaultEventType holds the default value on creation for the "event_type" field.
- DefaultEventType string
- // DefaultChatID holds the default value on creation for the "chat_id" field.
- DefaultChatID string
- // DefaultWorkidIdx holds the default value on creation for the "workid_idx" field.
- DefaultWorkidIdx int8
- // DefaultResponseRaw holds the default value on creation for the "response_raw" field.
- DefaultResponseRaw string
- // CallbackURLValidator is a validator for the "callback_url" field. It is called by the builders before save.
- CallbackURLValidator func(string) error
- // DefaultTaskStatus holds the default value on creation for the "task_status" field.
- DefaultTaskStatus int8
- // DefaultRetryCount holds the default value on creation for the "retry_count" field.
- DefaultRetryCount int8
- // DefaultLastError holds the default value on creation for the "last_error" field.
- DefaultLastError string
- )
- // OrderOption defines the ordering options for the CompapiAsynctask 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()
- }
- // 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()
- }
- // ByAuthToken orders the results by the auth_token field.
- func ByAuthToken(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldAuthToken, opts...).ToFunc()
- }
- // ByEventType orders the results by the event_type field.
- func ByEventType(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldEventType, opts...).ToFunc()
- }
- // ByChatID orders the results by the chat_id field.
- func ByChatID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldChatID, opts...).ToFunc()
- }
- // ByWorkidIdx orders the results by the workid_idx field.
- func ByWorkidIdx(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldWorkidIdx, opts...).ToFunc()
- }
- // ByOpenaiBase orders the results by the openai_base field.
- func ByOpenaiBase(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldOpenaiBase, opts...).ToFunc()
- }
- // ByOpenaiKey orders the results by the openai_key field.
- func ByOpenaiKey(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldOpenaiKey, opts...).ToFunc()
- }
- // ByRequestRaw orders the results by the request_raw field.
- func ByRequestRaw(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldRequestRaw, opts...).ToFunc()
- }
- // ByResponseRaw orders the results by the response_raw field.
- func ByResponseRaw(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldResponseRaw, opts...).ToFunc()
- }
- // ByCallbackURL orders the results by the callback_url field.
- func ByCallbackURL(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCallbackURL, opts...).ToFunc()
- }
- // ByTaskStatus orders the results by the task_status field.
- func ByTaskStatus(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldTaskStatus, opts...).ToFunc()
- }
- // ByRetryCount orders the results by the retry_count field.
- func ByRetryCount(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldRetryCount, opts...).ToFunc()
- }
- // ByLastError orders the results by the last_error field.
- func ByLastError(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldLastError, opts...).ToFunc()
- }
|