Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
Returns backup list in created_ts descending order and allow find list by status
天舟5d890d4fcbbe
diff --git a/api/backup.go b/api/backup.goindex 1ce0814138..025e5eb093 100644--- a/api/backup.go+++ b/api/backup.go@@ -116,7 +116,8 @@ type BackupFind struct {DatabaseId *int// Domain specific fields- Name *string+ Name *string+ Status *BackupStatus}func (find *BackupFind) String() string {@@ -201,6 +202,7 @@ type BackupSettingsMatch struct {type BackupService interface {CreateBackup(ctx context.Context, create *BackupCreate) (*Backup, error)FindBackup(ctx context.Context, find *BackupFind) (*Backup, error)+ // Returns backup list in created_ts descending order.FindBackupList(ctx context.Context, find *BackupFind) ([]*Backup, error)PatchBackup(ctx context.Context, patch *BackupPatch) (*Backup, error)FindBackupSetting(ctx context.Context, find *BackupSettingFind) (*BackupSetting, error)diff --git a/store/backup.go b/store/backup.goindex d46eece616..cc013ed448 100644--- a/store/backup.go+++ b/store/backup.go@@ -175,6 +175,9 @@ func (s *BackupService) findBackupList(ctx context.Context, tx *Tx, find *api.Baif v := find.Name; v != nil {where, args = append(where, "name = ?"), append(args, *v)}+ if v := find.Status; v != nil {+ where, args = append(where, "`status` = ?"), append(args, *v)+ }rows, err := tx.QueryContext(ctx, `SELECT@@ -192,7 +195,7 @@ func (s *BackupService) findBackupList(ctx context.Context, tx *Tx, find *api.Bapath,commentFROM backup- WHERE `+strings.Join(where, " AND "),+ WHERE `+strings.Join(where, " AND ")+` ORDER BY created_ts DESC`,args...,)if err != nil {