-
Notifications
You must be signed in to change notification settings - Fork 571
Description
Feature Description
I propose allowing the mssql extension to optionally load connection and group specifications from a dedicated external file (e.g., mssql-connections.json) instead of storing them exclusively in VS Code's standard settings.json.
Problem and Motivation
Currently, all database connection details are stored directly in VS Code's settings.json. Since the schema for a single connection is quite verbose (~20 attributes), managing multiple environments (Dev, Test, Prod) quickly results in a "wall of text" that makes the global or workspace settings file difficult to navigate.
Furthermore, sharing connection configurations across different workspaces currently requires manual copying and pasting. This is problematic for:
- Cleanliness: It bloats the primary editor configuration.
- Portability: Users cannot easily reference a single source of truth for their SQL environments across multiple distinct projects.
- Version Control: It is difficult to share project-wide settings via
.vscode/settings.jsonwithout also exposing personal connection aliases or environment-specific metadata.
This relates to themes discussed in #19780 regarding settings clutter and #18912 regarding dedicated config files.
Proposed Solution:
Introduce a new configuration key, "mssql.configPath", within VS Code's settings.json. This key would point to a .json or .jsonc file containing the "mssql.connections" and "mssql.connectionGroups" objects.
Configuration Precedence:
- High Priority: VS Code
settings.json(for local/immediate overrides). - Medium Priority: The external file defined in
"mssql.configPath". - Low Priority: Extension defaults.
Benefits:
- Maintainability: Keeps
settings.jsonlean and focused on editor behavior. - Portability: Allows a single external config file to be referenced by multiple VS Code instances or workspaces.
- Security & Workflow: Simplifies
.gitignoremanagement, allowing users to keep connection metadata outside of the main project repository if desired.
Additional Context:
Ideally, the external file would support standard JSONC (JSON with comments) to allow users to document their various environment connections.
Also, "mssql.configPath" should resolve environment variables (e.g., ${env:USER}), VS Code variables (${workspaceFolder}), and allow relative paths.
Related Area
- Connection dialog (SQL Server | Azure browse/Fabric browse)
- Query editor
- Query results panel
- Object Explorer
- GitHub Copilot integration
- Preview/Edit data
- Table Designer
- Schema Designer
- Schema Compare
- Local SQL Server Container provisioning
- SQL database in Fabric provisioning
- DACPAC/BACPAC export/import
- SQL Database projects
- Query Plan Visualizer
- Other (please describe below)
If you selected "Other", please describe the area
No response
Confirmation
- I have searched existing feature requests and couldn't find a match
- I want to help implement this feature