123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- // Code generated by ent, DO NOT EDIT.
- package chatsession
- import (
- "time"
- "entgo.io/ent"
- "entgo.io/ent/dialect/sql"
- )
- const (
- // Label holds the string label denoting the chatsession type in the database.
- Label = "chat_session"
- // 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"
- // FieldDeletedAt holds the string denoting the deleted_at field in the database.
- FieldDeletedAt = "deleted_at"
- // FieldName holds the string denoting the name field in the database.
- FieldName = "name"
- // FieldUserID holds the string denoting the user_id field in the database.
- FieldUserID = "user_id"
- // FieldBotID holds the string denoting the bot_id field in the database.
- FieldBotID = "bot_id"
- // FieldBotType holds the string denoting the bot_type field in the database.
- FieldBotType = "bot_type"
- // Table holds the table name of the chatsession in the database.
- Table = "chat_session"
- )
- // Columns holds all SQL columns for chatsession fields.
- var Columns = []string{
- FieldID,
- FieldCreatedAt,
- FieldUpdatedAt,
- FieldDeletedAt,
- FieldName,
- FieldUserID,
- FieldBotID,
- FieldBotType,
- }
- // 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 _ "wechat-api/ent/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
- // DefaultName holds the default value on creation for the "name" field.
- DefaultName string
- // DefaultUserID holds the default value on creation for the "user_id" field.
- DefaultUserID uint64
- // DefaultBotID holds the default value on creation for the "bot_id" field.
- DefaultBotID uint64
- // DefaultBotType holds the default value on creation for the "bot_type" field.
- DefaultBotType uint8
- )
- // OrderOption defines the ordering options for the ChatSession 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()
- }
- // ByDeletedAt orders the results by the deleted_at field.
- func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
- }
- // ByName orders the results by the name field.
- func ByName(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldName, opts...).ToFunc()
- }
- // ByUserID orders the results by the user_id field.
- func ByUserID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldUserID, opts...).ToFunc()
- }
- // ByBotID orders the results by the bot_id field.
- func ByBotID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldBotID, opts...).ToFunc()
- }
- // ByBotType orders the results by the bot_type field.
- func ByBotType(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldBotType, opts...).ToFunc()
- }
|