-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
The ODBC sqlcmd supports a -D flag that allows connecting using an ODBC Data Source Name (DSN) instead of specifying connection parameters directly.
Current State
- The -D flag is not implemented in go-sqlcmd
- Linux ODBC sqlcmd supports this for using pre-configured DSNs
Requested Behavior
When -D is specified, the -S parameter should be interpreted as a DSN name rather than a server name. The DSN would be looked up from the system's ODBC configuration (e.g., /etc/odbc.ini\ on Linux or ODBC Data Source Administrator on Windows).
Considerations
- go-sqlcmd uses go-mssqldb directly, not ODBC, so implementing DSN support would require:
- Parsing ODBC ini files to extract connection parameters
- Or, using CGO to call ODBC APIs (which would add complexity)
- This may require a design discussion to determine the best approach
References
- ODBC sqlcmd usage: -S <DSN_name> -D\ indicates that -S\ refers to a DSN
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request