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.
var scriptRunner = SqlScriptRunner.GetScriptRunner(new SetupModel
{
ConnectionString = "Server=localhost; Database=tests; User Id=sa; Password=pa55w0rd!;TrustServerCertificate=true",
FolderPath = "/mssql/scripts",
DataBaseType = DataBaseTypeEnum.Mssql
}).RunDeploy();
This example will be run all scripts (*.sql file) from folder /mssql/scripts folder and subfolders