Skip to content

[Enhancement]: Push users toward better practices #2230

@JerryNixon

Description

@JerryNixon

What happened?

Can we update dab init to create a .env file when a connection string is supplied?

Details:

  1. Create the .env file
  2. Use a default environment variable name my-connection-string

Simple .env file contents:

my-connection-string=whatever-the-user-provided
  1. Reference the environment variable name in the dab-config.json file.

Using variables in the JSON:

{
  "$schema": "...",
  "data-source": {
    "database-type": "mssql",
    "connection-string": "@env('my-connection-string')"
  }
}

Possible additional:

  1. Auto-create a .gitignore ignoring the .env file.

Simple .gitignore file contents:

.env

Considerations:

  1. What to do when there is already a .env file?
  2. What to do when there is already a .gitignore file?

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

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    clicriCustomer Reported issueenhancementNew feature or requesttriageissues to be triaged

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions