komga/test-postgres-connection.sh
duong.doan1 29692c738b feat: Complete Sprint 1 PostgreSQL infrastructure
- Add flyway-database-postgresql dependency
- Create DatabaseUdfProvider abstraction with SQLite/PostgreSQL implementations
- Update all DAO classes to use JooqUdfHelper for database-agnostic UDF/collation
- Implement dynamic JOOQ dialect configuration based on database type
- Add PostgreSQL migration directory with initial migration
- Create Docker Compose setup for PostgreSQL 16
- Add integration test with Testcontainers PostgreSQL
- Create helper scripts for local testing
- Update application.yml for simplified testing
- Add documentation and task tracking
2026-04-07 14:09:19 +07:00

22 lines
No EOL
699 B
Bash
Executable file

#!/bin/bash
# Simple test to check PostgreSQL connection
echo "Testing PostgreSQL connection..."
# Check if PostgreSQL container is running
if ! docker-compose ps postgres | grep -q "Up"; then
echo "PostgreSQL container is not running. Starting..."
docker-compose up -d postgres
sleep 5
fi
# Test connection from within container
echo "Testing connection from within container..."
docker exec komga-postgres psql -U komga -d komga -c "SELECT version();" 2>&1
# Test connection from host (if psql is installed)
echo -e "\nTesting extensions..."
docker exec komga-postgres psql -U komga -d komga -c "SELECT * FROM pg_extension;" 2>&1
echo -e "\nPostgreSQL is running and accessible!"