How to change the database user and password after installation

I am currently deploying nextcloud on my server via Kubernetes, that works without problem. But at the moment I have to store the password of the database in plaintext in my configuration.
I want to use Hashicorp Vault to automaticly generate a database user and password for one time use.
This however requires me to somehow tell nextcloud before startup what the new password is. I looked around the documentation for occ, but AFAICT there is no command that takes a database username and password and writes them to the config. Then I could use an init container to do the work for me.
If there is no such command, what encryption/hashing does the password in the config.php use so I can write a script myself?

you mean something like:

php occ config:system:set dbpassword --value "topsecret"

if it’s not dbpassword it’s may be dbpasswd. you’ll find it.

and i’m not shure if occ doesn’t checks the connection to the db before doing anything. that would fail of course.

The dbpassword is not hashed and not encrypted in config.php

It does, the command fails because of the obviously incorrect password.

It does work to simply edit the config file.