Passing DB credentials to a "global" pool connection in shiny?

I've been googling like a maniac trying to find what I am looking for so I'm starting to wonder if it's even possible.

Basically, as part of my shiny app (really the first step) I want the user to enter their Snowflake credentials and establish a pool that is sort of globally available to the rest of the app. Is that possible or am I fundamentally not getting how the shiny architecture works in assuming that such a thing can even be done?

If it is possible, can a brief example be provided?

Thank you


Welcome to the RStudio community!

If I understand it correctly, you want any one user to provide DB credentials that can be used by other users to access the database?

If that's the case, the logic is indeed flawed because the point of authentication is that only that specific user can get access. If anyone can get access, no authentication is needed and anyone can just use the database.

Please clarify if this is not what you meant.


I will clarify since that is not what I meant.

Most examples of shiny apps with database integration hardcode the user credentials and place the code for establishing the connection ahead of the ui/server sections in app.R.

For my application, it is critical that each user access the database via their own set of credentials. As such, I need to provide a login mechanism for them. I want to be able to utilize the advantages of the pool package so that the application isn't explicitly connecting, disconnecting, and then reconnecting every time the database is needed.

So basically, I'm wondering about the best way for the user to enter their credentials and establish the pool so it's available for the duration of the session. I hope that makes more sense.



Did you read this post?


This topic was automatically closed 54 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.