forked from ent/contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
messagewithoptionals.go
98 lines (84 loc) · 3.4 KB
/
messagewithoptionals.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// Code generated by ent, DO NOT EDIT.
package messagewithoptionals
import (
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the messagewithoptionals type in the database.
Label = "message_with_optionals"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldStrOptional holds the string denoting the str_optional field in the database.
FieldStrOptional = "str_optional"
// FieldIntOptional holds the string denoting the int_optional field in the database.
FieldIntOptional = "int_optional"
// FieldUintOptional holds the string denoting the uint_optional field in the database.
FieldUintOptional = "uint_optional"
// FieldFloatOptional holds the string denoting the float_optional field in the database.
FieldFloatOptional = "float_optional"
// FieldBoolOptional holds the string denoting the bool_optional field in the database.
FieldBoolOptional = "bool_optional"
// FieldBytesOptional holds the string denoting the bytes_optional field in the database.
FieldBytesOptional = "bytes_optional"
// FieldUUIDOptional holds the string denoting the uuid_optional field in the database.
FieldUUIDOptional = "uuid_optional"
// FieldTimeOptional holds the string denoting the time_optional field in the database.
FieldTimeOptional = "time_optional"
// Table holds the table name of the messagewithoptionals in the database.
Table = "message_with_optionals"
)
// Columns holds all SQL columns for messagewithoptionals fields.
var Columns = []string{
FieldID,
FieldStrOptional,
FieldIntOptional,
FieldUintOptional,
FieldFloatOptional,
FieldBoolOptional,
FieldBytesOptional,
FieldUUIDOptional,
FieldTimeOptional,
}
// 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
}
// Order defines the ordering method for the MessageWithOptionals queries.
type Order func(*sql.Selector)
// ByID orders the results by the id field.
func ByID(opts ...sql.OrderTermOption) Order {
return sql.OrderByField(FieldID, opts...).ToFunc()
}
// ByStrOptional orders the results by the str_optional field.
func ByStrOptional(opts ...sql.OrderTermOption) Order {
return sql.OrderByField(FieldStrOptional, opts...).ToFunc()
}
// ByIntOptional orders the results by the int_optional field.
func ByIntOptional(opts ...sql.OrderTermOption) Order {
return sql.OrderByField(FieldIntOptional, opts...).ToFunc()
}
// ByUintOptional orders the results by the uint_optional field.
func ByUintOptional(opts ...sql.OrderTermOption) Order {
return sql.OrderByField(FieldUintOptional, opts...).ToFunc()
}
// ByFloatOptional orders the results by the float_optional field.
func ByFloatOptional(opts ...sql.OrderTermOption) Order {
return sql.OrderByField(FieldFloatOptional, opts...).ToFunc()
}
// ByBoolOptional orders the results by the bool_optional field.
func ByBoolOptional(opts ...sql.OrderTermOption) Order {
return sql.OrderByField(FieldBoolOptional, opts...).ToFunc()
}
// ByUUIDOptional orders the results by the uuid_optional field.
func ByUUIDOptional(opts ...sql.OrderTermOption) Order {
return sql.OrderByField(FieldUUIDOptional, opts...).ToFunc()
}
// ByTimeOptional orders the results by the time_optional field.
func ByTimeOptional(opts ...sql.OrderTermOption) Order {
return sql.OrderByField(FieldTimeOptional, opts...).ToFunc()
}