Package Description
$ dotnet add package SqlScriptRunnerSQL script runner is a package, wich run script from concrete folder and subfolder. You can use it when you have database firs project and before start server you want to update your database.
From now the project will be separated into a few smaller packages. And now We don't have to install unnecessary connectors
var scriptRunner = SqlScriptRunner.GetScriptRunner(new SetupModel
{
ConnectionString = "Server=localhost; Database=tests; User Id=sa; Password=pa55w0rd!;TrustServerCertificate=true",
FolderPath = "/mssql/scripts",
InitFolderPath = "/mssql/scripts/init",
DataBaseType = DataBaseTypeEnum.Mssql
}).RunDeploy();
This example will be run all scripts (*.sql file) from folder /mssql/scripts folder and subfolders