Xledger.Sql provides tools for analyzing and transforming Transact SQL queries. This is provided in 3 main pieces:
Xledger.Sql.ScopedFragmentTransformer: aTSqlFragmentvisitor that tracks the scope of visits to ease context-aware rewrites.Xledger.Sql.Extensions: providing aReplaceScalarextension method to replace one scalar in its parent with a new scalar - without having to know exactly where in the parent the old scalar was present.Xledger.Sql.ImmutableDom: an immutable version ofMicrosoft.SqlServer.TransactSql.ScriptDomto enable caching parts of a SQL DOM or structural comparison of them.
The tests in Xledger.Sql.Test demonstrate how to use this library.
dotnet test Xledger.Sql.TestTo list the available tests:
dotnet test Xledger.Sql.Test --list-tests