DbUp parses the text of each SQL script for two purposes:
- To identify replacement tokens for our variable replacement
- In order to split statements into batches (in SQL Server that's splitting on "GO" statements)
Currently these two purposes are handled using the same parsing logic. This issue was opened to split these two purposes into their own code paths so that each can be handled by appropriate code.
Initially the Variable Substitution parsing will keep the existing SqlParser functionality.
To split the SQL Server T-SQL statements, the parsing will be achieved using a Microsoft-supplied package called "Microsoft.SqlServer.DacFx" which includes a T-SQL parser. This offloads the responsibility for writing a performant, resiliant, compliant parser.
A simple LINQPad-based proof-of-concept to split SQL into batches using Microsoft.SqlServer.DacFx which you can see here: DacFx Parsing LINQPad POC
Edited from original comment posted by @AdrianJSClark in DbUp/DbUp#439 (comment)
DbUp parses the text of each SQL script for two purposes:
Currently these two purposes are handled using the same parsing logic. This issue was opened to split these two purposes into their own code paths so that each can be handled by appropriate code.
Initially the Variable Substitution parsing will keep the existing
SqlParserfunctionality.To split the SQL Server T-SQL statements, the parsing will be achieved using a Microsoft-supplied package called "Microsoft.SqlServer.DacFx" which includes a T-SQL parser. This offloads the responsibility for writing a performant, resiliant, compliant parser.
A simple LINQPad-based proof-of-concept to split SQL into batches using
Microsoft.SqlServer.DacFxwhich you can see here: DacFx Parsing LINQPad POCEdited from original comment posted by @AdrianJSClark in DbUp/DbUp#439 (comment)