#!/usr/bin/env bash

# omarchy:summary=Install every database tool: the MongoDB, MySQL, PostgreSQL and SQLite shells with Compass, DBeaver and DbGate

# Based: the databases bundle runs its sibling rows in turn and keeps going
# past one that fails, then names what did not install. The SQL and
# MongoDB editor extensions come last.

set -o pipefail

failed=()
for row in mongosh mysql postgres sqlite compass dbeaver dbgate; do
  omarchy install development databases "$row" || failed+=("$row")
done

omarchy-code-extensions mtxr.sqltools mtxr.sqltools-driver-mysql mtxr.sqltools-driver-pg mtxr.sqltools-driver-sqlite mongodb.mongodb-vscode

if ((${#failed[@]})); then
  echo "Did not install: ${failed[*]}" >&2
  exit 1
fi
