Specifying connectionLimit in DATABASE_URL for Render.yaml

I’m currently dynamically setting the DATABASE_URL in my render.yaml configuration file and would like to specify the connectionLimit directly in the connection string.

Is there any way to include connectionLimit in a PostgreSQL connection URL? Here’s an example format for a PostgreSQL connection string:

postgres://username:password@hostname:port/dbname?connectionLimit=10

This is how I’m configuring my environment variables in render.yaml:

envVars:
  - key: DATABASE_URL
    fromDatabase:
      name: db-staging
      property: connectionString

Can I add connectionLimit or a similar parameter directly to the connection string within this setup? Any guidance would be appreciated!

Hi badeleux,

This isn’t possible with just environment variables. My suggestion would be to set a CONNECTION_LIMIT environment variable, then combine the DATABASE_URL with the CONNECTION_LIMIT variables in your application when you initialize your connection.

I’d also encourage you to submit a feature request at https://feedback.render.com/. It helps to include as much context as possible about your use case, the problem you’re looking to solve, and how you’re getting around it today to help us develop the best possible solution.

We rely heavily on customer feedback as a part of our planning and product roadmap process, so capturing interest on the feature request page is very helpful.

Regards,

Matt

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.