How to access dockerized nextcloud database

I installed nextcloud in docker by using this docker-compose.yml.


It’s actually working fine but I don’t know how to actually access the db inside the container.
I’m wondering if there’s a way to volume its database without losing my current data.

And by the way I chose postgres as its db during the installation.