1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-10 21:24:20 +01:00
fab-manager/scripts/pg-analyzers.sh

19 lines
489 B
Bash
Raw Normal View History

#!/usr/bin/env bash
docker-compose()
{
if ! docker compose version 1>/dev/null 2>/dev/null
then
if ! command docker-compose version 1>/dev/null 2>/dev/null
then
echo -e "\e[91m[ ❌ ] docker-compose was not found, exiting...\e[39m" && exit 1
else
command docker-compose "$@"
fi
else
docker compose "$@"
fi
}
docker-compose exec -T postgres psql -Upostgres -c \\dFd | head -n -2 | tail -n +3 | awk '{ print gensub(/([a-z]+)_stem/,"\\1","g",$3); }'