1
0
This commit is contained in:
2024-04-11 06:54:13 +09:00
parent 9d1838f75d
commit 0e4f081101
15 changed files with 540 additions and 28 deletions

View File

@ -30,6 +30,8 @@ const (
FieldUID = "uid"
// FieldCid holds the string denoting the cid field in the database.
FieldCid = "cid"
// FieldCard holds the string denoting the card field in the database.
FieldCard = "card"
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
FieldUpdatedAt = "updated_at"
// FieldCreatedAt holds the string denoting the created_at field in the database.
@ -58,6 +60,7 @@ var Columns = []string{
FieldDid,
FieldUID,
FieldCid,
FieldCard,
FieldUpdatedAt,
FieldCreatedAt,
}
@ -140,6 +143,11 @@ func ByCid(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCid, opts...).ToFunc()
}
// ByCard orders the results by the card field.
func ByCard(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCard, opts...).ToFunc()
}
// ByUpdatedAt orders the results by the updated_at field.
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()