🚧 Refactor backup service
This commit is contained in:
@@ -12,6 +12,8 @@ const (
|
||||
Label = "document"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldUUID holds the string denoting the uuid field in the database.
|
||||
FieldUUID = "uuid"
|
||||
// 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.
|
||||
@@ -31,6 +33,7 @@ const (
|
||||
// Columns holds all SQL columns for document fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldUUID,
|
||||
FieldCreatedAt,
|
||||
FieldUpdatedAt,
|
||||
FieldDeletedAt,
|
||||
@@ -57,6 +60,8 @@ func ValidColumn(column string) bool {
|
||||
var (
|
||||
Hooks [2]ent.Hook
|
||||
Interceptors [1]ent.Interceptor
|
||||
// DefaultUUID holds the default value on creation for the "uuid" field.
|
||||
DefaultUUID func() string
|
||||
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
||||
DefaultCreatedAt func() string
|
||||
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
||||
@@ -77,6 +82,11 @@ func ByID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByUUID orders the results by the uuid field.
|
||||
func ByUUID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldUUID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCreatedAt orders the results by the created_at field.
|
||||
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
||||
|
||||
@@ -53,6 +53,11 @@ func IDLTE(id int) predicate.Document {
|
||||
return predicate.Document(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// UUID applies equality check predicate on the "uuid" field. It's identical to UUIDEQ.
|
||||
func UUID(v string) predicate.Document {
|
||||
return predicate.Document(sql.FieldEQ(FieldUUID, v))
|
||||
}
|
||||
|
||||
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
|
||||
func CreatedAt(v string) predicate.Document {
|
||||
return predicate.Document(sql.FieldEQ(FieldCreatedAt, v))
|
||||
@@ -83,6 +88,81 @@ func Locked(v bool) predicate.Document {
|
||||
return predicate.Document(sql.FieldEQ(FieldLocked, v))
|
||||
}
|
||||
|
||||
// UUIDEQ applies the EQ predicate on the "uuid" field.
|
||||
func UUIDEQ(v string) predicate.Document {
|
||||
return predicate.Document(sql.FieldEQ(FieldUUID, v))
|
||||
}
|
||||
|
||||
// UUIDNEQ applies the NEQ predicate on the "uuid" field.
|
||||
func UUIDNEQ(v string) predicate.Document {
|
||||
return predicate.Document(sql.FieldNEQ(FieldUUID, v))
|
||||
}
|
||||
|
||||
// UUIDIn applies the In predicate on the "uuid" field.
|
||||
func UUIDIn(vs ...string) predicate.Document {
|
||||
return predicate.Document(sql.FieldIn(FieldUUID, vs...))
|
||||
}
|
||||
|
||||
// UUIDNotIn applies the NotIn predicate on the "uuid" field.
|
||||
func UUIDNotIn(vs ...string) predicate.Document {
|
||||
return predicate.Document(sql.FieldNotIn(FieldUUID, vs...))
|
||||
}
|
||||
|
||||
// UUIDGT applies the GT predicate on the "uuid" field.
|
||||
func UUIDGT(v string) predicate.Document {
|
||||
return predicate.Document(sql.FieldGT(FieldUUID, v))
|
||||
}
|
||||
|
||||
// UUIDGTE applies the GTE predicate on the "uuid" field.
|
||||
func UUIDGTE(v string) predicate.Document {
|
||||
return predicate.Document(sql.FieldGTE(FieldUUID, v))
|
||||
}
|
||||
|
||||
// UUIDLT applies the LT predicate on the "uuid" field.
|
||||
func UUIDLT(v string) predicate.Document {
|
||||
return predicate.Document(sql.FieldLT(FieldUUID, v))
|
||||
}
|
||||
|
||||
// UUIDLTE applies the LTE predicate on the "uuid" field.
|
||||
func UUIDLTE(v string) predicate.Document {
|
||||
return predicate.Document(sql.FieldLTE(FieldUUID, v))
|
||||
}
|
||||
|
||||
// UUIDContains applies the Contains predicate on the "uuid" field.
|
||||
func UUIDContains(v string) predicate.Document {
|
||||
return predicate.Document(sql.FieldContains(FieldUUID, v))
|
||||
}
|
||||
|
||||
// UUIDHasPrefix applies the HasPrefix predicate on the "uuid" field.
|
||||
func UUIDHasPrefix(v string) predicate.Document {
|
||||
return predicate.Document(sql.FieldHasPrefix(FieldUUID, v))
|
||||
}
|
||||
|
||||
// UUIDHasSuffix applies the HasSuffix predicate on the "uuid" field.
|
||||
func UUIDHasSuffix(v string) predicate.Document {
|
||||
return predicate.Document(sql.FieldHasSuffix(FieldUUID, v))
|
||||
}
|
||||
|
||||
// UUIDIsNil applies the IsNil predicate on the "uuid" field.
|
||||
func UUIDIsNil() predicate.Document {
|
||||
return predicate.Document(sql.FieldIsNull(FieldUUID))
|
||||
}
|
||||
|
||||
// UUIDNotNil applies the NotNil predicate on the "uuid" field.
|
||||
func UUIDNotNil() predicate.Document {
|
||||
return predicate.Document(sql.FieldNotNull(FieldUUID))
|
||||
}
|
||||
|
||||
// UUIDEqualFold applies the EqualFold predicate on the "uuid" field.
|
||||
func UUIDEqualFold(v string) predicate.Document {
|
||||
return predicate.Document(sql.FieldEqualFold(FieldUUID, v))
|
||||
}
|
||||
|
||||
// UUIDContainsFold applies the ContainsFold predicate on the "uuid" field.
|
||||
func UUIDContainsFold(v string) predicate.Document {
|
||||
return predicate.Document(sql.FieldContainsFold(FieldUUID, v))
|
||||
}
|
||||
|
||||
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
|
||||
func CreatedAtEQ(v string) predicate.Document {
|
||||
return predicate.Document(sql.FieldEQ(FieldCreatedAt, v))
|
||||
|
||||
Reference in New Issue
Block a user