Files

25 lines
653 B
Bash
Raw Permalink Normal View History

#!/bin/bash
# Database connection parameters for test database
DB_HOST="localhost"
DB_PORT="5430"
DB_USER="postgres"
DB_PASSWORD="pass"
DB_NAME="query_orchestration"
# Export password to avoid prompt
export PGPASSWORD="${DB_PASSWORD}"
# Connect to the database
echo "Connecting to test database at ${DB_HOST}:${DB_PORT}..."
echo "Database: ${DB_NAME}"
echo "User: ${DB_USER}"
echo ""
echo "Useful commands:"
echo " \\dt - List all tables"
echo " \\d tablename - Describe table structure"
echo " \\l - List all databases"
echo " \\q - Quit"
echo ""
psql -h "${DB_HOST}" -p "${DB_PORT}" -U "${DB_USER}" -d "${DB_NAME}"