The dotenv variable file is a variable file where you can add secret variables that should not be in your source version control system.
The dotenv file name has the following name structure:
.env[.name]
where:
If the name is:
The searched location is:
This file is generally added into your .gitignore file. This way, it's never committed into your repository version control system and stays local on your computer.
Example:
.env
Below are variables used to connect to the planete scale database.
PLANETSCALE_URL=jdbc:mysql://xxxxx.us-east-4.psdb.cloud/test?sslMode=VERIFY_IDENTITY
PLANETSCALE_USER=theSecretUser
PLANETSCALE_PWD=theSecretPassword
You can then use them as template variables in a connection vault.