How do I set Data Source password from environment variable in DataGrip?

456 Views Asked by At

To connect to DB I have to make an API call to generate a token. Lets say I store this in environment variable $TOKEN.

Now while setting up my data source in DataGrip, how can I tell DataGrip to read $TOKEN environment variable as its value will keep on changing? Because before opening DataGrip I will make the API call to generate the token and set in a environment variable via script.

Is it possible to read environment variable as a password in DataGrip?

1

There are 1 best solutions below

0
kassak On

There is no such feature out of the box.

You can create your custom plugin to provide this kind of authorisation. That is the matter of implementing of on class - com.intellij.database.dataSource.DatabaseAuthProvider

See this plugin as an example.