Architecture |
This topic contains an architecture overview of the SQL Enlight analysis feature.
This topic contains the following sections:
SQL Enlight Analysis feature depends on several components:
- SQL Parser
-
Parses the T-SQL code and results in an XML-based syntax tree of the SQL source code (SQML).
- Schema Reader
-
Load databases and server schema, and generate XML DOM representation of it (Analysis Context).
- Analysis Engine
-
Validates, Compiles XSLT analysis rules and applies them to the SQML and XML Analysis Context.
- XSLT Extensions
-
Can be used by the analysis rules and provide some additions to the standard XSLT and XPath functions as well as access to some of the internal SQL Enlight features.
The analysis goes through several steps:
-
Parse T-SQL code, validate the syntax and generate SQML.
-
Load database context and generate Analysis Context XML.
-
Generate XSLT template from available analysis rules expressions.
-
Apply XSLT transformation on the SQML of each T-SQL batch using all active batch scoped analysis rules. The analysis context and rule parameters are provided to the analysis rule as XSLT variables.
-
Apply XSLT transformation on the Analysis Context XML using all active Context Only analysis rules. The rule parameters and the analysis context are provided to the analysis rule as XSLT variables.
-
Reports rule violations.