Just for the recerence, it is possible to use Cloudflare Tunnel to connect to Postgres from Cloudflare Workers [1]. IIRC they also use WebSockets for communication between the Worker and the Tunnel.
Do you have any particular vault in mind? We are looking for a simple solution which would work exactly like you described. We just need couple of different sets of variables for our web server, workers and other services.
[1] https://developers.cloudflare.com/workers/tutorials/query-po...