blob: 75c4833fe0003e5c364d2ebc7c9e25d211c60ebc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!/usr/bin/env bash
# db — open an interactive database shell with project credentials
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=base.sh
source "$SCRIPT_DIR/base.sh"
# ── TODO: uncomment and configure for your database ──────────────────────────
# PostgreSQL
# exec psql "postgresql://$DB_USER:$DB_PASS@$DB_HOST:$DB_PORT/$DB_NAME"
# MySQL / MariaDB
# exec mysql -h "$DB_HOST" -P "$DB_PORT" -u "$DB_USER" -p"$DB_PASS" "$DB_NAME"
# SQLite
# exec sqlite3 "$PROJECT_ROOT/db.sqlite3"
# Redis
# exec redis-cli -h "$DB_HOST"
echo "error: no database configured in modes/db.sh" >&2
exit 1
|