feat: add CLI tool to export metadata (#6150)

* chore: add tool to export db meta

* chore: add meta restore command

* chore: fmt code

* chore: remove useless error

* chore: support key prefix

* chore: add clean check for meta restore

* chore: add more log for meta restore

* chore: resolve s3 and local file root in command meta-snapshot

* chore: remove the pg mysql features from the build script as they are already in the default feature

* chore: fix by pr comment
This commit is contained in:
localhost
2025-05-28 11:18:00 +08:00
committed by GitHub
parent 53752e4f6c
commit 92422dafca
17 changed files with 1026 additions and 87 deletions

View File

@@ -13,7 +13,10 @@
// limitations under the License.
use clap::Parser;
use cli::{BenchTableMetadataCommand, ExportCommand, ImportCommand, Tool};
use cli::{
BenchTableMetadataCommand, ExportCommand, ImportCommand, MetaRestoreCommand,
MetaSnapshotCommand, Tool,
};
use common_error::ext::BoxedError;
#[derive(Parser)]
@@ -22,6 +25,8 @@ pub enum SubCommand {
Bench(BenchTableMetadataCommand),
Export(ExportCommand),
Import(ImportCommand),
MetaSnapshot(MetaSnapshotCommand),
MetaRestore(MetaRestoreCommand),
}
impl SubCommand {
@@ -31,6 +36,8 @@ impl SubCommand {
SubCommand::Bench(cmd) => cmd.build().await,
SubCommand::Export(cmd) => cmd.build().await,
SubCommand::Import(cmd) => cmd.build().await,
SubCommand::MetaSnapshot(cmd) => cmd.build().await,
SubCommand::MetaRestore(cmd) => cmd.build().await,
}
}
}