Xledger.Sql provides tools for analyzing and transforming Transact SQL queries. This is provided in 3 main pieces:
Xledger.Sql.ScopedFragmentTransformer
: aTSqlFragment
visitor that tracks the scope of visits to ease context-aware rewrites.Xledger.Sql.Extensions
: providing aReplaceScalar
extension 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.ScriptDom
to 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.Test
To list the available tests:
dotnet test Xledger.Sql.Test --list-tests