diff --git a/.gitignore b/.gitignore index 8099e28231f..c3779e9d503 100644 --- a/.gitignore +++ b/.gitignore @@ -84,3 +84,4 @@ apps/streams/data/ # Generated by setup.sh Caddyfile +superset-dev-data/ diff --git a/.superset/setup.sh b/.superset/setup.sh index 53dc3adaa5d..d714cb12dba 100755 --- a/.superset/setup.sh +++ b/.superset/setup.sh @@ -10,11 +10,44 @@ NC='\033[0m' # Step tracking declare -a FAILED_STEPS=() declare -a SKIPPED_STEPS=() +FORCE_OVERWRITE_DATA=0 error() { echo -e "${RED}โœ—${NC} $1"; } success() { echo -e "${GREEN}โœ“${NC} $1"; } warn() { echo -e "${YELLOW}!${NC} $1"; } +print_usage() { + cat < /dev/null; then + sqlite3 "$dest_db" "PRAGMA wal_checkpoint(TRUNCATE);" &> /dev/null || true + fi + + success "Local DB seeded from $source_db" + return 0 +} + main() { + if ! parse_args "$@"; then + return 1 + fi + echo "๐Ÿš€ Setting up Superset workspace..." echo "" @@ -495,17 +587,22 @@ main() { step_failed "Install dependencies" fi - # Step 4: Setup Neon branch + # Step 4: Seed local DB into superset-dev-data/ + if ! step_seed_local_db; then + step_failed "Seed local DB" + fi + + # Step 5: Setup Neon branch if ! step_setup_neon_branch; then step_failed "Setup Neon branch" fi - # Step 5: Start Electric SQL + # Step 6: Start Electric SQL if ! step_start_electric; then step_failed "Start Electric SQL" fi - # Step 6: Write .env file + # Step 7: Write .env file if ! step_write_env; then step_failed "Write .env file" fi diff --git a/.superset/teardown.sh b/.superset/teardown.sh index e049943743c..c8c47d0fa35 100755 --- a/.superset/teardown.sh +++ b/.superset/teardown.sh @@ -10,11 +10,44 @@ NC='\033[0m' # Step tracking declare -a FAILED_STEPS=() declare -a SKIPPED_STEPS=() +REMOVE_DEV_DATA=0 error() { echo -e "${RED}โœ—${NC} $1"; } success() { echo -e "${GREEN}โœ“${NC} $1"; } warn() { echo -e "${YELLOW}!${NC} $1"; } +print_usage() { + cat <