Add MSSQL DB Batch Statement Support #1106
Open
+82
−17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds support for "batch" statements using the "GO" keyword supported by SQL IDEs such as SSMS or Azure Data Studio.
This logic for parsing the batched statements is implemented by the standard MSSQL DB driver:
github.com/microsoft/go-mssqldb
and specifically included in thegithub.com/microsoft/go-mssqldb/batch
package.By default this functionality is not enabled. To enable it, a configuration option named
BatchEnabled
must be set to true.This parameter can be set through the connection URL using the parameter
x-batch-enabled
.A common use case requiring batched statement is creating more than one view in a single file. SQL Server does not allow multiple views to be created in a single batch. Below is an example of multiple batches in a single migration file to create views:
This migration will result in an error about an unsupported command if the
BatchEnabled
option is not true.There is no breaking functionality.
Additionally, this PR introduces a new build artifact for Apple Silicon chips (M1, M2, M3, etc). It is a Darwin ARM64 build.