A VS Code extension that translates SQL Server connection strings between 7 different driver formats with intelligent auto-detection.
π Translate between 7 formats:
- SqlClient (.NET / C#)
- ODBC (Open Database Connectivity)
- OLEDB (Object Linking and Embedding Database)
- JDBC (Java Database Connectivity)
- PHP (sqlsrv extension)
- Python (mssql / pyodbc)
- Rust (mssql-tds / tiberius)
β¨ Key Features:
- Smart auto-detection with confidence scoring (high/medium/low)
- OLEDB Provider auto-injection - Automatically adds
Provider=MSOLEDBSQL;as first parameter - Translate to single or all formats with responsive grid layout
- 128+ keyword mappings across all drivers
- Comprehensive synonym support (e.g.,
Server=Data Source,UID=User ID) - Syntax validation with detailed error messages
- External CSS stylesheet for improved performance and maintainability
- One-click copy buttons for all translations
- History sidebar showing recent translations
- Real-time detection badges showing source format confidence
- Keyboard shortcuts for rapid workflow
code --install-extension sql-connection-string-translator-0.0.1.vsix- Download the
.vsixfile - Open VS Code Extensions view (
Ctrl+Shift+X/Cmd+Shift+X) - Click
...(More Actions) βInstall from VSIX... - Select the downloaded file
- Reload VS Code
- Open Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) - Type "Connection String: Open Translator"
- Press Enter
- Select a connection string in your editor
- Right-click and choose "Connection String: Translate Selection"
- Or use Command Palette: "Connection String: Translate Selection"
- Copy a connection string to clipboard
- Open Command Palette
- Type "Connection String: Translate from Clipboard"
- Open Command Palette
- Type "Connection String: Quick Translate to..."
- Paste your connection string
- Select target format
| Shortcut | Action |
|---|---|
Ctrl+Shift+C Ctrl+Shift+T |
Open Translator Panel |
Ctrl+Enter |
Translate (in panel) |
Ctrl+Shift+Enter |
Translate to All Formats (in panel) |
The extension supports 128+ keywords across all drivers, including:
- Server / Data Source / Address / Host
- Database / Initial Catalog
- Port
- User ID / UID / User
- Password / PWD
- Integrated Security / Trusted_Connection
- Authentication (Azure AD)
- Encrypt
- TrustServerCertificate
- HostNameInCertificate
- Connect Timeout / Connection Timeout / Login Timeout
- Command Timeout
- Pooling / Connection Pooling
- Min Pool Size / Max Pool Size
- Connection Lifetime
- MultiSubnetFailover
- ApplicationIntent
- FailoverPartner
- Application Name / App
- Workstation ID
The Python (mssql) driver has a restricted keyword allowlist. Some keywords like MultiSubnetFailover are blocked and will generate warnings.
Some keywords are driver-specific and cannot be translated. These will be listed with the reason:
NOT_SUPPORTED- Keyword not available in target driverBLOCKED_ALLOWLIST- Python driver restrictionDEPRECATED- Keyword is deprecatedDRIVER_SPECIFIC- Only works with source driver
Input (SqlClient):
Server=localhost;Database=TestDB;User ID=sa;Password=MyPass123;
Output (OLEDB):
Provider=MSOLEDBSQL;Data Source=localhost;Initial Catalog=TestDB;User ID=sa;Password=MyPass123;
Note: The
Provider=MSOLEDBSQL;keyword is automatically injected as the first parameter when translating to OLEDB format, as it's mandatory per OLEDB specification.
Input (SqlClient):
Server=myserver.database.windows.net;Database=mydb;User ID=admin;Password=secret;Encrypt=True;
Output (JDBC):
jdbc:sqlserver://myserver.database.windows.net:1433;databaseName=mydb;user=admin;password=secret;encrypt=true;
Input (ODBC):
Driver={ODBC Driver 18 for SQL Server};Server=localhost;Database=mydb;Trusted_Connection=Yes;
Output (Python):
Config(
server='localhost',
database='mydb',
trusted_connection='Yes',
)Input (SqlClient):
Server=localhost;Database=mydb;Integrated Security=True;
Output (Rust):
Config {
server: "localhost".to_string(),
database: Some("mydb".to_string()),
trust_cert: true,
..Default::default()
}The main translator panel features:
- Input textarea - Paste your connection string
- Source driver dropdown - Auto-detect or manually select source format
- Detection badge - Real-time confidence indicator (high/medium/low)
- Target driver dropdown - Select destination format
- Action buttons:
- Translate - Convert to selected target format
- Translate to All Formats - Generate all 7 formats in grid view
- Clear - Reset the form
When translating to all formats, results display in a responsive grid showing:
- Driver name and icon (Rust π¦)
- Warning icons
β οΈ for untranslatable keywords (with hover tooltips) - One-click copy button per format
- Color-coded output based on VS Code theme
The sidebar maintains a history of recent translations:
- Timestamp of each translation
- Source driver format
- Quick access to re-open previous translations
- Parser - Tokenizes connection strings into key-value pairs
- Detector - Identifies source driver format with confidence scoring
- Mapper - Translates keywords between driver formats (128+ mappings)
- Generator - Constructs target format connection strings
- Validator - Validates syntax and identifies errors/warnings
- TO OLEDB: Automatically injects
Provider=MSOLEDBSQL;as first parameter if missing - FROM OLEDB: Removes Provider keyword when translating to other formats
- Ensures compliance with OLEDB specification (Provider must be first)
Generates Python Config() struct initialization:
Config(
server='value',
database='value',
# ...
)Generates Rust struct initialization:
Config {
server: "value".to_string(),
database: Some("value".to_string()),
// ...
}- VS Code 1.80.0 or higher
This extension contributes the following settings:
- (Coming soon)
- Rust output generates struct initialization code, not a traditional connection string
- Python output generates Config struct initialization, not a traditional connection string
- Python driver has a restricted allowlist; some keywords will generate warnings
- Some advanced driver-specific keywords may not have mappings in all target drivers
Initial release with comprehensive features:
- β Translate between 7 SQL Server driver formats
- β Smart auto-detection with confidence scoring
- β OLEDB Provider keyword auto-injection
- β External CSS stylesheet architecture
- β 128+ keyword mappings with synonym support
- β Syntax validation with detailed error messages
- β Webview UI with responsive grid layout
- β History sidebar for recent translations
- β Context menu integration
- β Keyboard shortcuts for rapid workflow
- β One-click copy buttons
Technical Details:
- Extension size: 98 KB (92 files)
- Bundle size: 91.6 KB (optimized with webpack)
- CSS: External stylesheet with VS Code theme integration
π Full Release Notes
Contributions are welcome!
Repository: cheenamalhotra/sqlconnectionstrings
- Additional driver support (PostgreSQL, MySQL)
- Enhanced keyword mappings
- UI/UX improvements
- Documentation and examples
- Test coverage expansion
MIT License - See LICENSE file for details
Found a bug or have a feature request? Please open an issue on GitHub.
Developed with β€οΈ for the SQL Server community
