-
Notifications
You must be signed in to change notification settings - Fork 82
Labels
Priority: 3Low priority/impactLow priority/impactSize: SSmall issue (less than one week effort)Small issue (less than one week effort)enhancementNew feature or requestNew feature or request
Description
Description:
Currently, when users specify a config file with an unsupported extension (e.g., --sqlconfig myfile.txt), they receive a confusing Viper error: "Unsupported Config Type 'txt'".
Proposed Enhancement:
Add validation in internal/config/viper.go to check the file extension before passing to Viper and provide a clearer error message such as:
Error: Configuration files must use YAML format with .yaml or .yml extension.
The file 'myfile.txt' has an unsupported extension '.txt'.
Related:
- Issue Add documentation/help about supported config types #597 - Original documentation request
- PR Document that --sqlconfig flag only supports YAML format #684 - Documents YAML-only requirement
Implementation Notes:
- Check file extension in
configureViper()orSetFileName()function - Allow
.yaml,.yml, and no extension (for default~/.sqlcmd/sqlconfig) - Provide helpful error message pointing users to documentation
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Priority: 3Low priority/impactLow priority/impactSize: SSmall issue (less than one week effort)Small issue (less than one week effort)enhancementNew feature or requestNew feature or request