OVHcloud Community

Welcome to your community space. Ask questions, search for information, post content, and interact with other OVHcloud Community members.

Access to DB credentials at build time : using Knex.js, Next.js and Postgresql


Hello everyone, I’m coming to you because I wanted to deploy a Next.js project on a WebPaas server, and I encounter some issues.

At the build time I need to access to database credentials in order to Next.js to generate Static Page from db information. This process is called “Collecting page data…”.

I know that the PLATFORM_RELATIONSHIPS env variables is not accessible at build time, so how do I access to the db without it ?

I have tried to connect to database via an ssh:tunnels from my local pc and I was able to access to it.

It’s only at build time that I encounter this issues.

It’s my first ever post, so if I forgot some information, or if it is not clear, don’t hesitate to tell me.

Sorry for my English.

Thank’s in advance