data-api-builder
data-api-builder copied to clipboard
[Enhancement]: Push users toward better practices
What happened?
Can we update dab init to create a .env file when a connection string is supplied?
Details:
- Create the
.envfile - Use a default environment variable name
my-connection-string
Simple .env file contents:
my-connection-string=whatever-the-user-provided
- Reference the environment variable name in the
dab-config.jsonfile.
Using variables in the JSON:
{
"$schema": "...",
"data-source": {
"database-type": "mssql",
"connection-string": "@env('my-connection-string')"
}
}
Possible additional:
- Auto-create a
.gitignoreignoring the.envfile.
Simple .gitignore file contents:
.env
Considerations:
- What to do when there is already a
.envfile? - What to do when there is already a
.gitignorefile?
Version
Future
What database are you using?
Azure SQL
What hosting model are you using?
Local (including CLI)
Which API approach are you accessing DAB through?
REST, GraphQL
Relevant log output
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct