SqlScriptDOM
SqlScriptDOM copied to clipboard
ScriptDOM/SqlDOM is a .NET library for parsing T-SQL statements and interacting with its abstract syntax tree
For example, [TSqlFragmentVisitor](https://learn.microsoft.com/en-us/dotnet/api/microsoft.sqlserver.transactsql.scriptdom.tsqlfragmentvisitor?view=sql-dacfx-160) has virtual method for visiting DataModificationStatement - `ExplicitVisit(DataModificationStatement)` which can be overridden and "used" for whatever reason in an app... The thing is - it is never...
While diving deep into debugging my app I accidentally have noticed this: TSqlFragmentVisitor final code contains many blocks which check of `VisitBaseType` internal field value and if it is `true`...
ScriptDom version: 170.28.0 If column is marked as `PRIMARY KEY` inline then it begins to be parsed as MultipartIdentifier with a single identifier and all the other properties missing (-1...
Since you know specfically that the result is TSQLScript why turning it into a less comfortable to work with abstraction for consumers?  [top parse method](https://github.com/microsoft/SqlScriptDOM/blob/main/SqlScriptDom/Parser/TSql/TSqlParser.cs#L101)  [internal parse method](https://github.com/microsoft/SqlScriptDOM/blob/main/SqlScriptDom/Parser/TSql/TSql150Parser.cs#L72)...
When parsing thousands of scripts `foreach` approach generates at least N * 2 unnecessary enumerators, e.g. in TSQL160Parser [here](https://github.com/microsoft/SqlScriptDOM/blob/42f5cad3e7faeee7010a889ea09bea65512db84d/SqlScriptDom/Parser/TSql/TSql150Parser.cs#L89) and [here](https://github.com/microsoft/SqlScriptDOM/blob/42f5cad3e7faeee7010a889ea09bea65512db84d/SqlScriptDom/Parser/TSql/TSql150Parser.cs#L115). Also somewhere in the deep of generated code it...