plc.directory mirror
1// Code generated by ent, DO NOT EDIT.
2
3package syncstatus
4
5import (
6 "entgo.io/ent/dialect/sql"
7)
8
9const (
10 // Label holds the string label denoting the syncstatus type in the database.
11 Label = "sync_status"
12 // FieldID holds the string denoting the id field in the database.
13 FieldID = "id"
14 // FieldKey holds the string denoting the key field in the database.
15 FieldKey = "key"
16 // FieldLastOperationTime holds the string denoting the last_operation_time field in the database.
17 FieldLastOperationTime = "last_operation_time"
18 // FieldLastSyncTime holds the string denoting the last_sync_time field in the database.
19 FieldLastSyncTime = "last_sync_time"
20 // Table holds the table name of the syncstatus in the database.
21 Table = "sync_status"
22)
23
24// Columns holds all SQL columns for syncstatus fields.
25var Columns = []string{
26 FieldID,
27 FieldKey,
28 FieldLastOperationTime,
29 FieldLastSyncTime,
30}
31
32// ValidColumn reports if the column name is valid (part of the table columns).
33func ValidColumn(column string) bool {
34 for i := range Columns {
35 if column == Columns[i] {
36 return true
37 }
38 }
39 return false
40}
41
42// OrderOption defines the ordering options for the SyncStatus queries.
43type OrderOption func(*sql.Selector)
44
45// ByID orders the results by the id field.
46func ByID(opts ...sql.OrderTermOption) OrderOption {
47 return sql.OrderByField(FieldID, opts...).ToFunc()
48}
49
50// ByKey orders the results by the key field.
51func ByKey(opts ...sql.OrderTermOption) OrderOption {
52 return sql.OrderByField(FieldKey, opts...).ToFunc()
53}
54
55// ByLastOperationTime orders the results by the last_operation_time field.
56func ByLastOperationTime(opts ...sql.OrderTermOption) OrderOption {
57 return sql.OrderByField(FieldLastOperationTime, opts...).ToFunc()
58}
59
60// ByLastSyncTime orders the results by the last_sync_time field.
61func ByLastSyncTime(opts ...sql.OrderTermOption) OrderOption {
62 return sql.OrderByField(FieldLastSyncTime, opts...).ToFunc()
63}