Hexagon EAM SQL Validator
A Visual Studio Code extension that validates SQL code against a Hexagon EAM cloud tenant using the SOAP API.
Features
- Validates SQL code in the current file against your Hexagon EAM tenant
- Validates FlexSQL code for Hexagon EAM flex-triggers
- Secure credential management (password stored in memory only)
- Real-time validation with detailed error messages
- Keyboard shortcut support for quick validation
- Supports both standard SQL queries and FlexSQL trigger validation
Installation
- Clone or download this repository
- Open the folder in VS Code
- Run
npm install to install dependencies
- Press F5 to run the extension in debug mode
Configuration
Before using the extension, you need to configure your Hexagon EAM connection:
- Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
- Type "Hexagon EAM: Configure Connection"
- Enter your:
- SOAP API endpoint URL (e.g.,
https://your-tenant.eam.hexagoncloud.com/axis/services/EAMWebService)
- Username in format
userid@tenant (e.g., john.doe@company)
- Password (stored securely in memory only)
Finding Your Endpoint
Your Hexagon EAM SOAP endpoint typically follows this format:
https://[tenant].eam.hexagoncloud.com/axis/services/EAMWebService
Replace [tenant] with your organization's tenant name.
Usage
Validate SQL
- Open a SQL file in VS Code
- Either:
- Press
Ctrl+Shift+V (Windows/Linux) or Cmd+Shift+V (Mac)
- Or use Command Palette: "Hexagon EAM: Validate SQL"
- View the validation result in a popup
Validate FlexSQL (Trigger)
- Open a SQL file containing FlexSQL trigger code
- Either:
- Press
Ctrl+Shift+F (Windows/Linux) or Cmd+Shift+F (Mac)
- Or use Command Palette: "Hexagon EAM: Validate FlexSQL (Trigger)"
- View the validation result in a popup
Note: FlexSQL validation uses the MP6046 TestFlexSql service specifically for validating flex-trigger SQL statements.
Validation Results
- ✅ Success: Shows a confirmation that the SQL/FlexSQL is valid
- ❌ Failure: Shows the response code and error message from Hexagon EAM
SOAP API Details
The extension uses two Hexagon EAM SOAP web services:
1. MP6035 ValidateQuery (Standard SQL)
- Namespace:
http://schemas.datastream.net/MP_functions/MP6035_001
- Operation:
MP6035_ValidateQuery_001
- Element:
<mp1:QUERYTEXT>
- Use: General SQL query validation
2. MP6046 TestFlexSql (FlexSQL Triggers)
- Namespace:
http://schemas.datastream.net/MP_functions/MP6046_001
- Operation:
MP6046_TestFlexSql_001
- Element:
<mp1:SQLSTATEMENT>
- Use: Flex-trigger SQL validation
Common Configuration
- Authentication: WS-Security UsernameToken with format
userid@tenant
- Organization:
* (all organizations)
- Session: Terminates after each request
Response Handling
The extension interprets responses as follows:
Valid SQL:
- Response without SOAP Fault
- Contains MP6035_ValidateQuery_001 element
Invalid SQL:
- SOAP Fault with
soapenv:Fault
- Contains
ExceptionInfo with InvalidSQLException
- Error message in
<ns1:Message> tag (e.g., "De SQL-instructie is ongeldig: ORA-00942: table or view does not exist")
- Reason code in
<ns1:ReasonCode> tag
SOAP Errors:
- Authentication/authorization failures
- Network or service errors
- Extracted from
<faultstring> element
Customization
If you need to modify the SOAP structure, edit the callSoapAPI and parseSOAPResponse functions in src/extension.ts.
Development
Build
npm run compile
Watch Mode
npm run watch
Package Extension
npm install -g vsce
vsce package
This creates a .vsix file that can be installed in VS Code.
Requirements
- Visual Studio Code 1.80.0 or higher
- Node.js and npm
- Access to a Hexagon EAM cloud tenant
- Valid Hexagon EAM credentials
Security Notes
- Passwords are stored in memory only during the VS Code session
- Credentials are never written to disk or logged
- Always use HTTPS endpoints for production
Troubleshooting
"No response from server"
- Check your endpoint URL is correct
- Verify network connectivity to the Hexagon EAM tenant
- Ensure firewall/proxy settings allow SOAP requests
"SOAP API error"
- Verify your credentials are correct
- Check the SOAP envelope format matches your API version
- Review the response in the VS Code Developer Console
"SQL validation failed"
- Check the error message for specific SQL syntax issues
- Verify the SQL dialect matches Hexagon EAM requirements
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
License
MIT License - see LICENSE file for details