Best practices for database connection management


I have a broad question about (your personal) database connection best practices. I am kinda fed up with copy-pasting db connection info on top of my every script.

I thought about setting up a separate script for db connection and using source() but this also populates my current environment with unnecessary connection variables. Now, I am thinking about building a package with proprietary functions. The question is, whether it isn't an unnecessary overkill - I might be missing a simpler solution.

Also what would the best way of storing and retrieving sensitive data. Currently I am storing user & password in environmental variables.


Best-practices (

Securing Credentials (

1 Like

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.