Skip to content
Closed
Show file tree
Hide file tree
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
21 changes: 21 additions & 0 deletions engine/packages/engine/src/commands/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ pub enum SubCommand {
#[clap(short = 'q', long)]
query: Option<String>,
},
Nuke {
#[clap(long)]
yes: bool,
},
}

#[derive(ValueEnum, Clone, PartialEq)]
Expand Down Expand Up @@ -54,6 +58,23 @@ impl SubCommand {

Ok(())
}
Self::Nuke { yes } => {
if !yes {
bail!("Please pass '--yes' flag to confirm you want to nuke the database");
}

match config.database() {
rivet_config::config::Database::Postgres(_) => {
bail!("nuke postgres not implemented");
}
rivet_config::config::Database::FileSystem(file_system) => {
println!("Removing {}", file_system.path.display());
tokio::fs::remove_dir_all(&file_system.path).await?;
println!("Complete");
Ok(())
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion scripts/run/engine-rocksdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"

cd "${REPO_ROOT}"

RUST_LOG=debug \
RUST_LOG="${RUST_LOG:-debug}" \
cargo run --bin rivet-engine -- start "$@"
9 changes: 9 additions & 0 deletions scripts/run/nuke-rocksdb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"

cd "${REPO_ROOT}"

rm -rf "~/Library/Application Support/rivet-engine/"
Loading