moj-analytical-services / Rdbtools

Accessing Athena on the Analytical Platform
Other
4 stars 0 forks source link

reauthentication of credentials in MoJAthenaConnection objects #9

Closed pjrh-moj closed 2 years ago

pjrh-moj commented 2 years ago

This is basically copying the @mratford approach to reauthenticating an s3 object and applying it to an MoJAthenaConnection. I've stopped short of automatically refreshing credentials, since I'm not 100% sure that's a good idea for database connections, but it does now work. (It's easier in Rdbtools since we're already using an S4 object with environments for slots, so no closures required.)

The key thing is that you have to reauthenticate with the same session name, otherwise you lose access to any tables created under that session name. I can't find good documentation on this, but it does seem to work!

pjrh-moj commented 2 years ago

Yes - need to update the README!