Generate multiple PostgreSQL databases and users with restricted privileges
- Python >= 3.10
- Poetry
Install dependencies
poetry installDefine .env variables
cp .env.example .envFor testing purpose, run local docker image. Omit this step as you need.
./scripts/start.shAdd your pivate IP address to the authorized networks to your PostgreSQL instance. Go to your instance, then click on Connections (left side bar). Click on the Networking tab, click on Add network, choose a name for network (e.g., my-network), and click on Use My IP, Done, and finally Save. Note that you need to wait a few minutes for the changes to take effect. Now, you should be able to make connection to your PostgrSQL instance.
Run script 🚀
poetry run python src/main2.pyBy default, generated credentials are available in credentials.csv file.