Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --quick option to project dump command #463

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cmd/project/project_dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ var projectDatabaseDumpCmd = &cobra.Command{
skipLockTables, _ := cmd.Flags().GetBool("skip-lock-tables")
anonymize, _ := cmd.Flags().GetBool("anonymize")
compression, _ := cmd.Flags().GetString("compression")
quick, _ := cmd.Flags().GetBool("quick")

db, err := sql.Open("mysql", mysqlConfig.FormatDSN())
if err != nil {
Expand All @@ -61,6 +62,10 @@ var projectDatabaseDumpCmd = &cobra.Command{
opt = append(opt, database.OptionValue("skip-lock-tables", "1"))
}

if quick {
opt = append(opt, database.OptionValue("quick", "1"))
}

logger, _ := zap.NewProduction()
dumper, err := database.NewMySQLDumper(db, logger, service, opt...)
if err != nil {
Expand Down Expand Up @@ -333,4 +338,5 @@ func init() {
projectDatabaseDumpCmd.Flags().Bool("anonymize", false, "Anonymize customer data")
projectDatabaseDumpCmd.Flags().String("compression", "", "Compress the dump (gzip, zstd)")
projectDatabaseDumpCmd.Flags().Bool("zstd", false, "Zstd the whole dump")
projectDatabaseDumpCmd.Flags().Bool("quick", false, "Use quick option for mysqldump")
}