├── .github └── workflows │ └── ci.yml ├── .gitignore ├── Build ├── README.md ├── build.ps1 ├── create-images.ps1 ├── install-dependencies.ps1 ├── nuget.exe ├── scripts │ ├── Get-ModuleVersion.ps1 │ ├── Get-ReleaseVersion.ps1 │ ├── Invoke-InstallDotNet.ps1 │ ├── Invoke-InstallModule.ps1 │ ├── Remove-DirectoryRecurse.ps1 │ ├── Start-Container.ps1 │ ├── Start-Mssql.ps1 │ ├── Start-Mysql.ps1 │ ├── Start-Pgsql.ps1 │ ├── Wait-Connection.ps1 │ ├── Wait-Mssql.ps1 │ ├── Wait-Mysql.ps1 │ └── Wait-Pgsql.ps1 ├── show-powershell-images.ps1 ├── tasks │ ├── build-tasks.it-linux.ps1 │ ├── build-tasks.it-ps-core.ps1 │ ├── build-tasks.it-ps-desktop.ps1 │ ├── build-tasks.it-tool-linux.ps1 │ ├── build-tasks.it-win.ps1 │ ├── build-tasks.ps1 │ ├── build-tasks.third-party.ps1 │ ├── build-tasks.unit-test.ps1 │ └── create-images-tasks.ps1 ├── tests.txt └── third-party-libraries │ ├── configuration │ ├── appsettings.json │ ├── nuget.org-readme-template.txt │ ├── readme-template.txt │ └── third-party-notices-template.txt │ ├── licenses │ ├── apache-2.0 │ │ ├── index.json │ │ └── license.txt │ ├── bsd-2-clause │ │ ├── index.json │ │ └── license.txt │ ├── bsd-3-clause │ │ ├── index.json │ │ └── license.txt │ ├── mit │ │ ├── index.json │ │ └── license.txt │ ├── ms-net-library │ │ ├── index.json │ │ └── license.html │ └── postgresql │ │ ├── index.json │ │ └── license.txt │ ├── packages │ └── nuget.org │ │ ├── castle.core │ │ └── 5.1.1 │ │ │ ├── index.json │ │ │ ├── package-LICENSE │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE │ │ │ └── third-party-notices.txt │ │ ├── dapper.strongname │ │ └── 2.1.35 │ │ │ ├── index.json │ │ │ ├── package.nuspec │ │ │ ├── project-License.txt │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-License.txt │ │ │ └── third-party-notices.txt │ │ ├── diffengine │ │ └── 11.3.0 │ │ │ ├── index.json │ │ │ ├── package.nuspec │ │ │ ├── project-license.txt │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-license.txt │ │ │ └── third-party-notices.txt │ │ ├── emptyfiles │ │ └── 4.4.0 │ │ │ ├── index.json │ │ │ ├── package.nuspec │ │ │ ├── project-license.txt │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-license.txt │ │ │ └── third-party-notices.txt │ │ ├── microsoft.bcl.asyncinterfaces │ │ └── 8.0.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE.TXT │ │ │ └── third-party-notices.txt │ │ ├── microsoft.bcl.hashcode │ │ └── 1.1.1 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── microsoft.codecoverage │ │ └── 17.11.1 │ │ │ ├── index.json │ │ │ ├── package.nuspec │ │ │ ├── project-LICENSE │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE │ │ │ └── third-party-notices.txt │ │ ├── microsoft.csharp │ │ └── 4.7.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── microsoft.extensions.dependencyinjection.abstractions │ │ └── 8.0.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE.TXT │ │ │ └── third-party-notices.txt │ │ ├── microsoft.extensions.logging.abstractions │ │ ├── 7.0.1 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE.TXT │ │ │ └── third-party-notices.txt │ │ └── 8.0.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE.TXT │ │ │ └── third-party-notices.txt │ │ ├── microsoft.net.test.sdk │ │ └── 17.11.1 │ │ │ ├── index.json │ │ │ ├── package.nuspec │ │ │ ├── project-LICENSE │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE │ │ │ └── third-party-notices.txt │ │ ├── microsoft.testplatform.objectmodel │ │ └── 17.11.1 │ │ │ ├── index.json │ │ │ ├── package.nuspec │ │ │ ├── project-LICENSE │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE │ │ │ └── third-party-notices.txt │ │ ├── microsoft.testplatform.testhost │ │ └── 17.11.1 │ │ │ ├── index.json │ │ │ ├── package.nuspec │ │ │ ├── project-LICENSE │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE │ │ │ └── third-party-notices.txt │ │ ├── microsoft.win32.registry │ │ └── 4.7.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.txt │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── moq │ │ └── 4.20.72 │ │ │ ├── index.json │ │ │ ├── package.nuspec │ │ │ ├── project-License.txt │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-License.txt │ │ │ └── third-party-notices.txt │ │ ├── mysqlconnector │ │ └── 2.3.7 │ │ │ ├── index.json │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE │ │ │ └── third-party-notices.txt │ │ ├── netstandard.library │ │ └── 2.0.3 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.txt │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── newtonsoft.json │ │ ├── 13.0.1 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.md │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE.md │ │ │ └── third-party-notices.txt │ │ └── 13.0.3 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.md │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE.md │ │ │ └── third-party-notices.txt │ │ ├── npgsql │ │ └── 8.0.5 │ │ │ ├── index.json │ │ │ ├── package.nuspec │ │ │ ├── project-LICENSE │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE │ │ │ └── third-party-notices.txt │ │ ├── nunit │ │ └── 4.2.2 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.txt │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE.txt │ │ │ └── third-party-notices.txt │ │ ├── nunit3testadapter │ │ └── 4.6.0 │ │ │ ├── index.json │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE │ │ │ └── third-party-notices.txt │ │ ├── powershellstandard.library │ │ └── 5.1.1 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.txt │ │ │ ├── package.nuspec │ │ │ ├── project-LICENSE.txt │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── shouldly │ │ └── 4.2.1 │ │ │ ├── index.json │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE.txt │ │ │ └── third-party-notices.txt │ │ ├── stylecop.analyzers.unstable │ │ └── 1.2.0.556 │ │ │ ├── index.json │ │ │ ├── package-LICENSE │ │ │ ├── package.nuspec │ │ │ ├── project-LICENSE │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── system.buffers │ │ └── 4.5.1 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.txt │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── system.codedom │ │ └── 6.0.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE.TXT │ │ │ └── third-party-notices.txt │ │ ├── system.collections.immutable │ │ └── 8.0.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE.TXT │ │ │ └── third-party-notices.txt │ │ ├── system.data.sqlclient │ │ └── 4.8.6 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── system.diagnostics.diagnosticsource │ │ ├── 4.7.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.txt │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── 7.0.2 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE.TXT │ │ │ └── third-party-notices.txt │ │ └── 8.0.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE.TXT │ │ │ └── third-party-notices.txt │ │ ├── system.diagnostics.eventlog │ │ └── 4.7.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── system.management │ │ └── 6.0.1 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE.TXT │ │ │ └── third-party-notices.txt │ │ ├── system.memory │ │ ├── 4.5.4 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.txt │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ └── 4.5.5 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── system.numerics.vectors │ │ ├── 4.4.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.txt │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ └── 4.5.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── system.reflection.emit.ilgeneration │ │ └── 4.7.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── system.reflection.emit │ │ └── 4.7.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── system.reflection.metadata │ │ └── 1.6.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.txt │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── system.runtime.compilerservices.unsafe │ │ ├── 4.5.3 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.txt │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── 4.7.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.txt │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ └── 6.0.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE.TXT │ │ │ └── third-party-notices.txt │ │ ├── system.runtime.loader │ │ └── 4.3.0 │ │ │ ├── index.json │ │ │ ├── package-dotnet_library_license.txt │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── system.security.accesscontrol │ │ └── 4.7.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.txt │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── system.security.principal.windows │ │ └── 4.7.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.txt │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── system.text.encoding.codepages │ │ └── 4.7.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.txt │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ ├── system.text.encodings.web │ │ └── 8.0.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE.TXT │ │ │ └── third-party-notices.txt │ │ ├── system.text.json │ │ └── 8.0.5 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE.TXT │ │ │ └── third-party-notices.txt │ │ ├── system.threading.channels │ │ └── 8.0.0 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.TXT │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ ├── repository-LICENSE.TXT │ │ │ └── third-party-notices.txt │ │ ├── system.threading.tasks.extensions │ │ └── 4.5.4 │ │ │ ├── index.json │ │ │ ├── package-LICENSE.txt │ │ │ ├── package.nuspec │ │ │ ├── readme.md │ │ │ ├── remarks.md │ │ │ └── third-party-notices.txt │ │ └── system.valuetuple │ │ └── 4.5.0 │ │ ├── index.json │ │ ├── package-LICENSE.TXT │ │ ├── package.nuspec │ │ ├── readme.md │ │ ├── remarks.md │ │ └── third-party-notices.txt │ └── readme.md ├── Examples ├── CSharpMirationStep │ ├── CSharpMirationStep.csproj │ ├── SqlDatabaseScript.MsSql.cs │ ├── SqlDatabaseScript.MySql.cs │ ├── SqlDatabaseScript.PgSql.cs │ └── readme.md ├── ConfigurationFile │ ├── README.md │ └── SqlDatabase.dll.config ├── CreateDatabaseFolder │ ├── 01_database │ │ ├── 01_DropExisting.sql │ │ ├── 02_Create.sql │ │ └── 03_Version.sql │ ├── 02_schemas │ │ └── 01_demo.sql │ ├── 03_tables │ │ ├── 01_demo.Department.sql │ │ └── 02_demo.Employee.sql │ ├── 05_data │ │ └── 01_staff.sql │ └── README.md ├── ExecuteScriptsFolder │ ├── 01_demo.sql │ ├── 02_demo.Department.sql │ ├── 03_demo.Employee.sql │ ├── README.md │ └── data │ │ └── 01_staff.sql ├── ExportData │ └── README.md ├── MigrationStepsFolder │ ├── Modularity │ │ ├── README.md │ │ ├── book_1.0_2.0.sql │ │ ├── person_1.0_2.0.sql │ │ └── reader_1.0_2.0.sql │ ├── README.md │ └── StraightForward │ │ ├── 1.0_1.1.sql │ │ ├── 1.1_2.0.sql │ │ ├── 2.0_3.0.sql │ │ └── README.md ├── PackageManagerConsole │ ├── PackageManagerConsole.sln │ ├── README.md │ ├── SolutionScripts │ │ ├── Install-Database.psm1 │ │ ├── SolutionScripts.csproj │ │ ├── SqlDatabase.config │ │ ├── Update-Database.psm1 │ │ └── _database-tools.psm1 │ ├── SomeApp │ │ ├── App.config │ │ ├── Program.cs │ │ └── SomeApp.csproj │ └── Sreen.png ├── PowerShellScript │ ├── example.ps1 │ └── readme.md └── SqlServerDockerImage │ ├── README.md │ ├── create-database-build-image.ps1 │ ├── create-database-scripts │ ├── 01_database │ │ ├── 01_DropExisting.sql │ │ ├── 02_Create.sql │ │ └── 03_Version.sql │ ├── 02_schemas │ │ └── 01_demo.sql │ ├── 03_tables │ │ ├── 01_demo.Department.sql │ │ └── 02_demo.Employee.sql │ └── 05_data │ │ └── 01_staff.sql │ ├── create-database.dockerfile │ ├── upgrade-database-build-image.ps1 │ ├── upgrade-database-scripts.dockerfile │ └── upgrade-database-scripts │ ├── 1.0_1.1.sql │ └── 1.1_2.0.sql ├── LICENSE.md ├── README.md ├── Sources ├── Directory.Build.props ├── Directory.Packages.props ├── Docker │ ├── docker-compose.yml │ ├── image-dotnet-runtime-6.0.dockerfile │ ├── image-dotnet-runtime-8.0.dockerfile │ ├── image-dotnet-runtime-9.0.dockerfile │ ├── image-dotnet-sdk-6.0.dockerfile │ ├── image-dotnet-sdk-8.0.dockerfile │ ├── image-dotnet-sdk-9.0.dockerfile │ ├── image-mssql-2017.dockerfile │ ├── image-mysql-8025.dockerfile │ ├── image-postgres-133.dockerfile │ ├── mssql.create-database.sql │ ├── mysql.create-database.sql │ └── pgsql.create-database.sql ├── IntegrationTests │ ├── MsSql │ │ ├── Execute │ │ │ └── drop.database.sql │ │ ├── Export │ │ │ └── export.sql │ │ ├── New │ │ │ ├── 01.Tables │ │ │ │ ├── 01.Person.sql │ │ │ │ └── 02.PersonAddress.sql │ │ │ ├── 01.create.sql │ │ │ ├── 02.Data │ │ │ │ ├── 01.Person.sql │ │ │ │ └── 02.PersonAddress.sql │ │ │ ├── 02.schemas.ps1 │ │ │ └── 03.version.sql │ │ ├── Test.ps1 │ │ ├── Test.sh │ │ ├── TestGlobalTool.sh │ │ ├── TestPowerShell.ps1 │ │ ├── Upgrade │ │ │ ├── 1.0_1.2.sql │ │ │ ├── 1.2_2.0.ps1 │ │ │ ├── 2.0_2.1.sql │ │ │ └── SqlDatabase.exe.config │ │ └── UpgradeModularity │ │ │ ├── SqlDatabase.exe.config │ │ │ ├── moduleA_1.0_2.0.sql │ │ │ ├── moduleB_1.0_1.1.sql │ │ │ ├── moduleC_1.0_2.0.ps1 │ │ │ └── moduleC_1.0_2.0.txt │ ├── MySql │ │ ├── Execute │ │ │ └── drop.database.ps1 │ │ ├── Export │ │ │ └── export.sql │ │ ├── New │ │ │ ├── 01.Tables │ │ │ │ ├── 01.person.sql │ │ │ │ └── 02.person_address.sql │ │ │ ├── 01.create.sql │ │ │ ├── 02.Data │ │ │ │ ├── 01.person.sql │ │ │ │ └── 02.person_address.sql │ │ │ └── 05.version.sql │ │ ├── Test.ps1 │ │ ├── Test.sh │ │ ├── TestGlobalTool.sh │ │ ├── TestPowerShell.ps1 │ │ ├── Upgrade │ │ │ ├── 1.0_1.2.sql │ │ │ ├── 1.2_2.0.ps1 │ │ │ ├── 2.0_2.1.sql │ │ │ └── SqlDatabase.exe.config │ │ └── UpgradeModularity │ │ │ ├── SqlDatabase.exe.config │ │ │ ├── moduleA_1.0_2.0.sql │ │ │ ├── moduleB_1.0_1.1.sql │ │ │ ├── moduleC_1.0_2.0.ps1 │ │ │ └── moduleC_1.0_2.0.txt │ └── PgSql │ │ ├── Execute │ │ └── drop.database.ps1 │ │ ├── Export │ │ └── export.sql │ │ ├── New │ │ ├── 01.Tables │ │ │ ├── 01.person.sql │ │ │ └── 02.person_address.sql │ │ ├── 01.drop.ps1 │ │ ├── 02.Data │ │ │ ├── 01.person.sql │ │ │ └── 02.person_address.sql │ │ ├── 02.create.sql │ │ ├── 03.database_properties.sql │ │ ├── 04.schemas.sql │ │ └── 05.version.sql │ │ ├── Test.ps1 │ │ ├── Test.sh │ │ ├── TestGlobalTool.sh │ │ ├── TestPowerShell.ps1 │ │ ├── Upgrade │ │ ├── 1.0_1.2.sql │ │ ├── 1.2_2.0.ps1 │ │ ├── 2.0_2.1.sql │ │ └── SqlDatabase.exe.config │ │ └── UpgradeModularity │ │ ├── SqlDatabase.exe.config │ │ ├── moduleA_1.0_2.0.sql │ │ ├── moduleB_1.0_1.1.sql │ │ ├── moduleC_1.0_2.0.ps1 │ │ └── moduleC_1.0_2.0.txt ├── SqlDatabase.Adapter.AssemblyScripts.Test │ ├── AssemblyScriptFactoryTest.cs │ ├── AssemblyScriptTest.cs │ ├── DbCommandStub.cs │ ├── DefaultEntryPointTest.cs │ ├── EntryPointResolverTest.Stubs.cs │ ├── EntryPointResolverTest.cs │ ├── ExecuteMethodResolverCommandDictionaryTest.cs │ ├── ExecuteMethodResolverCommandTest.cs │ ├── ExecuteMethodResolverDbConnectionTest.cs │ ├── ExecuteMethodResolverDictionaryCommandTest.cs │ ├── ExecuteMethodResolverSqlConnectionTest.cs │ ├── Net472 │ │ ├── Net472SubDomainTest.StepWithSubDomain.cs │ │ └── Net472SubDomainTest.cs │ ├── NetCore │ │ ├── NetCoreSubDomainTest.StepWithSubDomain.cs │ │ └── NetCoreSubDomainTest.cs │ └── SqlDatabase.Adapter.AssemblyScripts.Test.csproj ├── SqlDatabase.Adapter.AssemblyScripts │ ├── AssemblyScript.cs │ ├── AssemblyScriptFactory.cs │ ├── CodeAnalysis │ │ ├── AllowNullAttribute.cs │ │ └── NotNullWhenAttribute.cs │ ├── ConsoleListener.cs │ ├── DefaultEntryPoint.cs │ ├── EntryPointResolver.cs │ ├── ExecuteMethodResolverBase.cs │ ├── ExecuteMethodResolverCommand.cs │ ├── ExecuteMethodResolverCommandDictionary.cs │ ├── ExecuteMethodResolverDbConnection.cs │ ├── ExecuteMethodResolverDictionaryCommand.cs │ ├── ExecuteMethodResolverSqlConnection.cs │ ├── IEntryPoint.cs │ ├── ISubDomain.cs │ ├── Net472 │ │ ├── AppDomainAdapter.cs │ │ ├── DomainAgent.cs │ │ ├── DomainDirectory.cs │ │ ├── LoggerProxy.cs │ │ └── Net472SubDomain.cs │ ├── NetCore │ │ ├── AssemblyContext.cs │ │ └── NetCoreSubDomain.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SqlDatabase.Adapter.AssemblyScripts.csproj │ ├── SubDomainFactory.cs │ └── VariablesProxy.cs ├── SqlDatabase.Adapter.MsSql.Test │ ├── MsSqlDataExporterTest.cs │ ├── MsSqlDatabaseAdapterFactoryTest.cs │ ├── MsSqlDatabaseAdapterTest.cs │ ├── MsSqlQuery.cs │ ├── MsSqlTextReaderTest.Go │ │ ├── Case01.sql │ │ ├── Case02.sql │ │ ├── CaseOneLineComment.sql │ │ └── CaseStoredProcedure.sql │ ├── MsSqlTextReaderTest.cs │ ├── MsSqlWriterTest.cs │ ├── SqlDatabase.Adapter.MsSql.Test.csproj │ ├── TextScriptOutputMsSqlTest.cs │ └── app.config ├── SqlDatabase.Adapter.MsSql │ ├── MsSqlDatabaseAdapter.cs │ ├── MsSqlDatabaseAdapterFactory.cs │ ├── MsSqlDefaults.cs │ ├── MsSqlTextReader.cs │ ├── MsSqlValueDataReader.cs │ ├── MsSqlWriter.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── SqlDatabase.Adapter.MsSql.csproj ├── SqlDatabase.Adapter.MySql.Test │ ├── MySqlDataExporterTest.cs │ ├── MySqlDatabaseAdapterTest.cs │ ├── MySqlQuery.cs │ ├── MySqlTextReaderTest.cs │ ├── MySqlWriterTest.cs │ ├── SqlDatabase.Adapter.MySql.Test.csproj │ ├── TextScriptOutputMySqlTest.cs │ └── app.config ├── SqlDatabase.Adapter.MySql │ ├── MySqlDatabaseAdapter.cs │ ├── MySqlDatabaseAdapterFactory.cs │ ├── MySqlDefaults.cs │ ├── MySqlTextReader.cs │ ├── MySqlValueDataReader.cs │ ├── MySqlWriter.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── SqlDatabase.Adapter.MySql.csproj ├── SqlDatabase.Adapter.PgSql.Test │ ├── PgSqlDataExporterTest.cs │ ├── PgSqlDatabaseAdapterTest.cs │ ├── PgSqlQuery.cs │ ├── PgSqlTextReaderTest.cs │ ├── PgSqlWriterTest.cs │ ├── SqlDatabase.Adapter.PgSql.Test.csproj │ ├── TextScriptOutputPgSqlTest.cs │ └── app.config ├── SqlDatabase.Adapter.PgSql │ ├── PgSqlDatabaseAdapter.cs │ ├── PgSqlDatabaseAdapterFactory.cs │ ├── PgSqlDefaults.cs │ ├── PgSqlTextReader.cs │ ├── PgSqlValueDataReader.cs │ ├── PgSqlWriter.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SqlDatabase.Adapter.PgSql.csproj │ └── UnmappedTypes │ │ ├── Composite.cs │ │ ├── CompositeValueReader.cs │ │ └── DataReaderExtensions.cs ├── SqlDatabase.Adapter.PowerShellScripts.Test │ ├── InstallationInfoTest.cs │ ├── InstallationSeekerTest.cs │ ├── PowerShellLinuxTest.cs │ ├── PowerShellScriptFactoryTest.cs │ ├── PowerShellScriptTest.cs │ ├── PowerShellTest.ExecuteWhatIfIgnore.ps1 │ ├── PowerShellTest.ExecuteWhatIfInvoke.ps1 │ ├── PowerShellTest.HandleOutput.ps1 │ ├── PowerShellTest.HandleThrow.ps1 │ ├── PowerShellTest.HandleWriteError.ps1 │ ├── PowerShellTest.ParametersBinding.ps1 │ ├── PowerShellTest.cs │ ├── PowerShellWindowsTest.cs │ └── SqlDatabase.Adapter.PowerShellScripts.Test.csproj ├── SqlDatabase.Adapter.PowerShellScripts │ ├── CodeAnalysis │ │ ├── AllowNullAttribute.cs │ │ └── NotNullWhenAttribute.cs │ ├── DiagnosticsTools.cs │ ├── IPowerShell.cs │ ├── IPowerShellFactory.cs │ ├── InstallationInfo.cs │ ├── InstallationSeeker.cs │ ├── PowerShell.cs │ ├── PowerShellAssemblyLoadContextInitializerAdapter.cs │ ├── PowerShellFactory.cs │ ├── PowerShellLinux.cs │ ├── PowerShellScript.cs │ ├── PowerShellScriptFactory.cs │ ├── PowerShellStreamsListener.cs │ ├── PowerShellWindows.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── ReflectionTools.cs │ ├── SqlDatabase.Adapter.PowerShellScripts.csproj │ └── VariablesProxy.cs ├── SqlDatabase.Adapter.Sql.Test │ ├── Export │ │ └── DataExportLoggerTest.cs │ ├── SqlDatabase.Adapter.Sql.Test.csproj │ ├── SqlScriptVariableParserTest.cs │ └── TextScriptTest.cs ├── SqlDatabase.Adapter.Sql │ ├── Export │ │ ├── DataExportLogger.cs │ │ ├── DataExporter.cs │ │ └── IDataExporter.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SqlDatabase.Adapter.Sql.csproj │ ├── SqlScriptVariableParser.cs │ ├── TextScript.cs │ └── TextScriptFactory.cs ├── SqlDatabase.Adapter │ ├── DataReaderTools.cs │ ├── ExportTable.cs │ ├── ExportTableColumn.cs │ ├── HostedRuntime.cs │ ├── IDatabaseAdapter.cs │ ├── ILogger.cs │ ├── IScript.cs │ ├── IScriptEnvironment.cs │ ├── IScriptFactory.cs │ ├── ISqlTextReader.cs │ ├── IValueDataReader.cs │ ├── IVariables.cs │ ├── LoggerExtensions.cs │ ├── SqlDatabase.Adapter.csproj │ ├── SqlWriterBase.cs │ └── TransactionMode.cs ├── SqlDatabase.CommandLine.Test │ ├── CommandLineParserTest.cs │ ├── Internal │ │ └── ArgTest.cs │ └── SqlDatabase.CommandLine.Test.csproj ├── SqlDatabase.CommandLine │ ├── CodeAnalysis │ │ ├── AllowNullAttribute.cs │ │ └── NotNullWhenAttribute.cs │ ├── CommandLineParser.cs │ ├── CreateCommandLine.cs │ ├── ExecuteCommandLine.cs │ ├── ExportCommandLine.cs │ ├── ICommandLine.cs │ ├── Internal │ │ ├── Arg.cs │ │ ├── ArgNames.cs │ │ ├── CommandLineBinder.cs │ │ ├── CommandLineBinderExtensions.cs │ │ ├── EnumArgBinder.cs │ │ ├── IArgBinder.cs │ │ ├── ScriptSourceArgBinder.cs │ │ ├── StringArgBinder.cs │ │ ├── SwitchArgBinder.cs │ │ └── VariableArgBinder.cs │ ├── InvalidCommandLineException.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── ScriptSource.cs │ ├── SqlDatabase.CommandLine.csproj │ └── UpgradeCommandLine.cs ├── SqlDatabase.Configuration.Test │ ├── AppConfiguration.default.xml │ ├── AppConfiguration.empty.xml │ ├── AppConfiguration.full.xml │ ├── AppConfigurationTest.cs │ ├── ConfigurationManagerTest.cs │ ├── SqlDatabase.Configuration.Test.csproj │ └── SqlDatabase.dll.config ├── SqlDatabase.Configuration │ ├── AppConfiguration.cs │ ├── AssemblyScriptConfiguration.cs │ ├── ConfigurationErrorsException.cs │ ├── ConfigurationManager.cs │ ├── ConfigurationReader.cs │ ├── DatabaseConfiguration.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── SqlDatabase.Configuration.csproj ├── SqlDatabase.FileSystem.Test │ ├── Content.zip │ ├── FileSystemFactoryTest.cs │ ├── FileSystemFileTest.cs │ ├── FileSystemFolderTest.cs │ ├── InLineScriptFileTest.cs │ ├── SqlDatabase.FileSystem.Test.csproj │ └── ZipFolderTest.cs ├── SqlDatabase.FileSystem │ ├── CodeAnalysis │ │ ├── AllowNullAttribute.cs │ │ └── NotNullWhenAttribute.cs │ ├── FileSystemFactory.cs │ ├── FileSystemFile.cs │ ├── FileSystemFolder.cs │ ├── FileTools.cs │ ├── IFile.cs │ ├── IFileSystemFactory.cs │ ├── IFileSystemInfo.cs │ ├── IFolder.cs │ ├── InLineScriptFile.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SqlDatabase.FileSystem.csproj │ ├── ZipEntryFolder.cs │ ├── ZipFolder.cs │ ├── ZipFolderFile.EntryStream.cs │ └── ZipFolderFile.cs ├── SqlDatabase.Package │ ├── SqlDatabase.Package.csproj │ ├── choco │ │ ├── sqldatabase.nuspec │ │ └── tools │ │ │ ├── .skipAutoUninstaller │ │ │ ├── VERIFICATION.txt │ │ │ ├── chocolateybeforemodify.ps1 │ │ │ ├── chocolateyinstall.ps1 │ │ │ └── chocolateyuninstall.ps1 │ └── nuget │ │ ├── package.nuspec │ │ └── tools │ │ └── init.ps1 ├── SqlDatabase.PowerShell.Internal │ ├── CmdLetExecutor.cs │ ├── CmdLetLogger.cs │ ├── CommandLineTools.cs │ ├── ISqlDatabaseProgram.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SqlDatabase.PowerShell.Internal.csproj │ └── SqlDatabaseProgram.cs ├── SqlDatabase.PowerShell.Test │ ├── CreateCmdLetTest.cs │ ├── ExecuteCmdLetTest.cs │ ├── ExportCmdLetTest.cs │ ├── InfoCmdLetTest.cs │ ├── Internal │ │ └── DependencyResolverFactoryTest.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SqlDatabase.PowerShell.Test.csproj │ ├── TestApi │ │ └── SqlDatabaseCmdLetTest.cs │ └── UpgradeCmdLetTest.cs ├── SqlDatabase.PowerShell │ ├── Copy-Dependency.ps1 │ ├── CreateCmdLet.cs │ ├── ExecuteCmdLet.cs │ ├── ExportCmdLet.cs │ ├── InfoCmdLet.cs │ ├── Internal │ │ ├── AssemblyCache.cs │ │ ├── CmdLetExecutorInvoker.cs │ │ ├── CmdLetLogger.cs │ │ ├── CmdletExtensions.cs │ │ ├── DependencyResolverFactory.cs │ │ ├── IDependencyResolver.cs │ │ ├── PSVersionTable.cs │ │ ├── PowerShellCommand.cs │ │ ├── PowerShellCoreAssemblyContext.cs │ │ ├── PowerShellCoreDependencyResolver.cs │ │ └── PowerShellDesktopDependencyResolver.cs │ ├── PSTransactionMode.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SqlDatabase.PowerShell.csproj │ ├── SqlDatabase.psd1 │ ├── SqlDatabase.psm1 │ └── UpgradeCmdLet.cs ├── SqlDatabase.Sequence.Test │ ├── CreateScriptSequenceTest.cs │ ├── DependencyParserTest.cs │ ├── DependencyParserTest │ │ ├── Case01.sql │ │ ├── Case02.sql │ │ ├── Case03.sql │ │ ├── Case04.sql │ │ ├── Case05.sql │ │ └── Empty.sql │ ├── ModuleVersionResolverTest.cs │ ├── SqlDatabase.Sequence.Test.csproj │ ├── UpgradeScriptCollectionTest.cs │ ├── UpgradeScriptSequenceTest.cs │ └── UpgradeScriptSequenceTest │ │ ├── FolderAsModuleName.json │ │ ├── OneModule.json │ │ ├── ThreeModules.json │ │ └── TwoModules.json ├── SqlDatabase.Sequence │ ├── CodeAnalysis │ │ ├── AllowNullAttribute.cs │ │ └── NotNullWhenAttribute.cs │ ├── CreateScriptSequence.cs │ ├── DependencyParser.cs │ ├── GetDatabaseCurrentVersion.cs │ ├── ICreateScriptSequence.cs │ ├── IModuleVersionResolver.cs │ ├── IUpgradeScriptSequence.cs │ ├── ModuleVersionResolver.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── ScriptDependency.cs │ ├── ScriptStep.cs │ ├── SqlDatabase.Sequence.csproj │ ├── UpgradeScriptCollection.cs │ └── UpgradeScriptSequence.cs ├── SqlDatabase.Test │ ├── Commands │ │ ├── DatabaseCreateCommandTest.cs │ │ ├── DatabaseExecuteCommandTest.cs │ │ ├── DatabaseExportCommandTest.cs │ │ └── DatabaseUpgradeCommandTest.cs │ ├── Configuration │ │ ├── EnvironmentBuilderTest.cs │ │ └── HostedRuntimeResolverTest.cs │ ├── Log │ │ ├── CombinedLoggerTest.cs │ │ ├── FileLoggerTest.cs │ │ └── LoggerBaseTest.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Scripts │ │ ├── DatabaseAdapterFactoryTest.cs │ │ ├── DatabaseTest.cs │ │ ├── ScriptResolverTest.cs │ │ └── VariablesTest.cs │ └── SqlDatabase.Test.csproj ├── SqlDatabase.TestApi │ ├── ConfigurationExtensions.cs │ ├── FileFactory.cs │ ├── ResourceReader.cs │ ├── SqlDatabase.TestApi.csproj │ ├── TempConsoleOut.cs │ ├── TempDirectory.cs │ ├── TempFile.cs │ ├── TestOutput.cs │ └── TextExtensions.cs ├── SqlDatabase.sln ├── SqlDatabase.sln.DotSettings ├── SqlDatabase.snk ├── SqlDatabase │ ├── App.config │ ├── CodeAnalysis │ │ ├── AllowNullAttribute.cs │ │ └── NotNullWhenAttribute.cs │ ├── Commands │ │ ├── CommandFactory.cs │ │ ├── DatabaseCommandBase.cs │ │ ├── DatabaseCreateCommand.cs │ │ ├── DatabaseExecuteCommand.cs │ │ ├── DatabaseExportCommand.cs │ │ ├── DatabaseUpgradeCommand.cs │ │ └── ICommand.cs │ ├── Configuration │ │ ├── CommandLine.create.net472.txt │ │ ├── CommandLine.create.txt │ │ ├── CommandLine.execute.net472.txt │ │ ├── CommandLine.execute.txt │ │ ├── CommandLine.export.net472.txt │ │ ├── CommandLine.export.txt │ │ ├── CommandLine.txt │ │ ├── CommandLine.upgrade.net472.txt │ │ ├── CommandLine.upgrade.txt │ │ ├── EnvironmentBuilder.cs │ │ ├── HostedRuntimeResolver.cs │ │ └── IEnvironmentBuilder.cs │ ├── ExitCode.cs │ ├── Log │ │ ├── CombinedLogger.cs │ │ ├── ConsoleLogger.cs │ │ ├── DisposableAction.cs │ │ ├── FileLogger.cs │ │ ├── LoggerBase.cs │ │ └── LoggerFactory.cs │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Scripts │ │ ├── Database.cs │ │ ├── DatabaseAdapterFactory.cs │ │ ├── IDatabase.cs │ │ ├── IScriptResolver.cs │ │ ├── ScriptResolver.cs │ │ ├── VariableSource.cs │ │ └── Variables.cs │ └── SqlDatabase.csproj ├── StyleCope.ruleset ├── global.json ├── nuget.config └── stylecop.json └── icon-32.png /.gitignore: -------------------------------------------------------------------------------- 1 | obj/ 2 | bin/ 3 | .vs/ 4 | build.out/ 5 | 6 | launchSettings.json 7 | launchSettings.txt 8 | *.sln.DotSettings.user 9 | *.csproj.user 10 | 11 | todo.txt -------------------------------------------------------------------------------- /Build/build.ps1: -------------------------------------------------------------------------------- 1 | #Requires -Version "7.0" 2 | #Requires -Modules @{ ModuleName="InvokeBuild"; ModuleVersion="5.11.3" } 3 | #Requires -Modules @{ ModuleName="ThirdPartyLibraries"; ModuleVersion="3.6.0" } 4 | 5 | [CmdletBinding()] 6 | param ( 7 | [Parameter()] 8 | [ValidateSet('local', 'github')] 9 | [string] 10 | $Mode, 11 | 12 | [Parameter()] 13 | [string] 14 | $GithubToken 15 | ) 16 | 17 | Set-StrictMode -Version Latest 18 | $ErrorActionPreference = 'Stop' 19 | 20 | $file = Join-Path $PSScriptRoot 'tasks/build-tasks.ps1' 21 | $task = ($Mode -eq 'github') ? 'GithubBuild' : 'LocalBuild' 22 | 23 | Invoke-Build -File $file -Task $task -GithubToken $GithubToken -------------------------------------------------------------------------------- /Build/create-images.ps1: -------------------------------------------------------------------------------- 1 | #Requires -Version "7.0" 2 | #Requires -Modules @{ ModuleName="InvokeBuild"; ModuleVersion="5.11.3" } 3 | 4 | Set-StrictMode -Version Latest 5 | 6 | $file = Join-Path $PSScriptRoot 'tasks/create-images-tasks.ps1' 7 | Invoke-Build -File $file -------------------------------------------------------------------------------- /Build/nuget.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/nuget.exe -------------------------------------------------------------------------------- /Build/scripts/Get-ModuleVersion.ps1: -------------------------------------------------------------------------------- 1 | function Get-ModuleVersion { 2 | param ( 3 | [Parameter(Mandatory)] 4 | [string] 5 | $Name 6 | ) 7 | 8 | $sources = Get-Content (Join-Path $PSScriptRoot '../build.ps1') -Raw 9 | $tokens = $null 10 | $errors = $null 11 | $modules = [Management.Automation.Language.Parser]::ParseInput($sources, [ref]$tokens, [ref]$errors).ScriptRequirements.RequiredModules 12 | foreach ($module in $modules) { 13 | if ($module.Name -eq $Name) { 14 | return $module.Version 15 | } 16 | } 17 | 18 | throw "Module $Name not found." 19 | } -------------------------------------------------------------------------------- /Build/scripts/Get-ReleaseVersion.ps1: -------------------------------------------------------------------------------- 1 | function Get-ReleaseVersion { 2 | param ( 3 | [Parameter(Mandatory)] 4 | [ValidateScript({ Test-Path $_ })] 5 | [string] 6 | $SourcePath 7 | ) 8 | 9 | $buildProps = Join-Path $SourcePath 'Directory.Build.props' 10 | $xml = Select-Xml -Path $buildProps -XPath 'Project/PropertyGroup/SqlDatabaseVersion' 11 | 12 | $xml.Node.InnerText 13 | } -------------------------------------------------------------------------------- /Build/scripts/Invoke-InstallModule.ps1: -------------------------------------------------------------------------------- 1 | function Invoke-InstallModule { 2 | [CmdletBinding()] 3 | param ( 4 | [Parameter(Mandatory)] 5 | [string] 6 | $Name, 7 | 8 | [Parameter(Mandatory)] 9 | [string] 10 | $Version 11 | ) 12 | 13 | $test = Get-InstalledModule -Name $Name -MinimumVersion $Version -ErrorAction 'SilentlyContinue' 14 | if ($test) { 15 | Write-Output "$Name $($test.Version) is alredy installed" 16 | return 17 | } 18 | 19 | Write-Output "Install $Name $version" 20 | Install-Module -Name $Name -RequiredVersion $Version -Force 21 | } -------------------------------------------------------------------------------- /Build/scripts/Remove-DirectoryRecurse.ps1: -------------------------------------------------------------------------------- 1 | function Remove-DirectoryRecurse { 2 | param ( 3 | [Parameter(Mandatory)] 4 | [string] 5 | $Path, 6 | 7 | [Parameter()] 8 | [string[]] 9 | $Filters 10 | ) 11 | 12 | if (-not (Test-Path $Path)) { 13 | return 14 | } 15 | 16 | if ($Filters) { 17 | foreach ($filter in $Filters) { 18 | Get-ChildItem -Path $Path -Filter $filter -Directory -Recurse | Remove-Item -Recurse -Force 19 | } 20 | } 21 | else { 22 | Remove-Item -Path $Path -Recurse -Force 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Build/scripts/Start-Mssql.ps1: -------------------------------------------------------------------------------- 1 | function Start-Mssql { 2 | param () 3 | 4 | $container = Start-Container -Image sqldatabase/mssql:2017 -ContainerPort 1433 5 | $port = $container.port 6 | 7 | $builder = New-Object -TypeName System.Data.SqlClient.SqlConnectionStringBuilder 8 | $builder['Initial Catalog'] = 'SqlDatabaseTest' 9 | $builder['User Id'] = 'sa' 10 | $builder['Password'] = 'P@ssw0rd' 11 | $builder['Connect Timeout'] = 5 12 | 13 | $builder['Data Source'] = ".,$port" 14 | $connectionString = $builder.ToString() 15 | 16 | $builder['Data Source'] = $container.ip 17 | $remoteConnectionString = $builder.ToString() 18 | 19 | return @{ 20 | containerId = $container.containerId 21 | connectionString = $connectionString 22 | remoteConnectionString = $remoteConnectionString 23 | } 24 | } -------------------------------------------------------------------------------- /Build/scripts/Wait-Mssql.ps1: -------------------------------------------------------------------------------- 1 | function Wait-Mssql { 2 | param ( 3 | [Parameter(Mandatory)] 4 | [string] 5 | $ConnectionString 6 | ) 7 | 8 | Wait-Connection -ConnectionName System.Data.SqlClient.SqlConnection -ConnectionString $ConnectionString 9 | } -------------------------------------------------------------------------------- /Build/scripts/Wait-Mysql.ps1: -------------------------------------------------------------------------------- 1 | function Wait-Mysql { 2 | param ( 3 | [Parameter(Mandatory)] 4 | [string] 5 | $ConnectionString 6 | ) 7 | 8 | Wait-Connection -ConnectionName MySqlConnector.MySqlConnection -ConnectionString $ConnectionString 9 | } -------------------------------------------------------------------------------- /Build/scripts/Wait-Pgsql.ps1: -------------------------------------------------------------------------------- 1 | function Wait-Pgsql { 2 | param ( 3 | [Parameter(Mandatory)] 4 | [string] 5 | $ConnectionString 6 | ) 7 | 8 | Wait-Connection -ConnectionName Npgsql.NpgsqlConnection -ConnectionString $ConnectionString 9 | } -------------------------------------------------------------------------------- /Build/tests.txt: -------------------------------------------------------------------------------- 1 | mcr.microsoft.com/powershell:6.0.2-ubuntu-16.04 2 | Create-SqlDatabase : Invalid command line. ---> Could not load file or assembly 'System.Data.SqlClient, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. 3 | 4 | mcr.microsoft.com/powershell:6.0.4-ubuntu-16.04 5 | Create-SqlDatabase : Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified. -------------------------------------------------------------------------------- /Build/third-party-libraries/configuration/third-party-notices-template.txt: -------------------------------------------------------------------------------- 1 | {{Title}} 2 | {% for i in (1..Title.size) %}*{% endfor %} 3 | 4 | THIRD-PARTY SOFTWARE NOTICES AND INFORMATION 5 | 6 | {% for package in Packages -%} 7 | {{package.Name}} ({{package.HRef}}) 8 | {%- if package.Author -%} 9 | Authors: {{package.Author}} 10 | {%- endif -%} 11 | {%- if package.Copyright -%} 12 | Copyright: {{package.Copyright}} 13 | {%- endif -%} 14 | License: {{package.License.FullName}}, full text can be found at{% for i in package.License.HRefs %} {{i}}{% endfor %} 15 | {%- if package.ThirdPartyNotices -%} 16 | 17 | {{package.ThirdPartyNotices}} 18 | {%- endif -%} 19 | 20 | {% endfor -%} 21 | -------------------------------------------------------------------------------- /Build/third-party-libraries/licenses/apache-2.0/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Code": "Apache-2.0", 3 | "FullName": "Apache License 2.0", 4 | "RequiresApproval": false, 5 | "RequiresThirdPartyNotices": false, 6 | "HRef": "https://spdx.org/licenses/Apache-2.0", 7 | "FileName": "license.txt", 8 | "Dependencies": [] 9 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/licenses/bsd-2-clause/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Code": "BSD-2-Clause", 3 | "FullName": "BSD 2-Clause \"Simplified\" License", 4 | "RequiresApproval": false, 5 | "RequiresThirdPartyNotices": false, 6 | "HRef": "https://spdx.org/licenses/BSD-2-Clause", 7 | "FileName": "license.txt", 8 | "Dependencies": [] 9 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/licenses/bsd-3-clause/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Code": "BSD-3-Clause", 3 | "FullName": "BSD 3-Clause \"New\" or \"Revised\" License", 4 | "RequiresApproval": false, 5 | "RequiresThirdPartyNotices": false, 6 | "HRef": "https://spdx.org/licenses/BSD-3-Clause", 7 | "FileName": "license.txt", 8 | "Dependencies": [] 9 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/licenses/mit/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Code": "MIT", 3 | "FullName": "MIT License", 4 | "RequiresApproval": false, 5 | "RequiresThirdPartyNotices": false, 6 | "HRef": "https://spdx.org/licenses/MIT", 7 | "FileName": "license.txt", 8 | "Dependencies": [] 9 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/licenses/ms-net-library/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Code": "ms-net-library", 3 | "FullName": "MICROSOFT .NET LIBRARY", 4 | "RequiresApproval": false, 5 | "RequiresThirdPartyNotices": false, 6 | "HRef": "https://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm", 7 | "FileName": "license.html", 8 | "Dependencies": [] 9 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/licenses/ms-net-library/license.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/licenses/ms-net-library/license.html -------------------------------------------------------------------------------- /Build/third-party-libraries/licenses/postgresql/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Code": "PostgreSQL", 3 | "FullName": "PostgreSQL License", 4 | "RequiresApproval": false, 5 | "RequiresThirdPartyNotices": false, 6 | "HRef": "https://spdx.org/licenses/PostgreSQL", 7 | "FileName": "license.txt", 8 | "Dependencies": [] 9 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/castle.core/5.1.1/package-LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2004-2021 Castle Project - http://www.castleproject.org/ 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/castle.core/5.1.1/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/castle.core/5.1.1/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/castle.core/5.1.1/repository-LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2004-2021 Castle Project - http://www.castleproject.org/ 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/castle.core/5.1.1/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/castle.core/5.1.1/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/dapper.strongname/2.1.35/project-License.txt: -------------------------------------------------------------------------------- 1 | The Dapper library and tools are licenced under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 2 | 3 | The Dapper logo is copyright Marc Gravell 2021 onwards; it is fine to use the Dapper logo when referencing the Dapper library and utilities, but 4 | the Dapper logo (including derivatives) must not be used in a way that misrepresents an external product or library as being affiliated or endorsed 5 | with Dapper. For example, you must not use the Dapper logo as the package icon on your own external tool (even if it uses Dapper internally), 6 | without written permission. If in doubt: ask. -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/dapper.strongname/2.1.35/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/dapper.strongname/2.1.35/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/dapper.strongname/2.1.35/repository-License.txt: -------------------------------------------------------------------------------- 1 | The Dapper library and tools are licenced under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 2 | 3 | The Dapper logo is copyright Marc Gravell 2021 onwards; it is fine to use the Dapper logo when referencing the Dapper library and utilities, but 4 | the Dapper logo (including derivatives) must not be used in a way that misrepresents an external product or library as being affiliated or endorsed 5 | with Dapper. For example, you must not use the Dapper logo as the package icon on your own external tool (even if it uses Dapper internally), 6 | without written permission. If in doubt: ask. -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/dapper.strongname/2.1.35/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/dapper.strongname/2.1.35/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/diffengine/11.3.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/diffengine/11.3.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/diffengine/11.3.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/diffengine/11.3.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/emptyfiles/4.4.0/readme.md: -------------------------------------------------------------------------------- 1 | EmptyFiles [4.4.0](https://www.nuget.org/packages/EmptyFiles/4.4.0) 2 | -------------------- 3 | 4 | Used by: SqlDatabase internal 5 | 6 | Target frameworks: netstandard2.0 7 | 8 | License: [MIT](../../../../licenses/mit) 9 | 10 | - package license: [MIT](https://licenses.nuget.org/MIT) 11 | - repository license: [MIT](https://github.com/SimonCropp/EmptyFiles.git) 12 | - project license: [MIT](https://github.com/SimonCropp/EmptyFiles) 13 | 14 | Description 15 | ----------- 16 | A collection of minimal binary files. 17 | 18 | Remarks 19 | ----------- 20 | no remarks 21 | 22 | 23 | Dependencies 1 24 | ----------- 25 | 26 | |Name|Version| 27 | |----------|:----| 28 | |[System.Memory](../../../../packages/nuget.org/system.memory/4.5.5)|4.5.5| 29 | 30 | *This page was generated by a tool.* -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/emptyfiles/4.4.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/emptyfiles/4.4.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/emptyfiles/4.4.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/emptyfiles/4.4.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.bcl.asyncinterfaces/8.0.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.bcl.asyncinterfaces/8.0.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.bcl.asyncinterfaces/8.0.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.bcl.asyncinterfaces/8.0.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.bcl.hashcode/1.1.1/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Source": "https://api.nuget.org/v3/index.json", 3 | "License": { 4 | "Code": "MIT", 5 | "Status": "AutomaticallyApproved" 6 | }, 7 | "UsedBy": [ 8 | { 9 | "Name": "SqlDatabase", 10 | "InternalOnly": false, 11 | "TargetFrameworks": [ 12 | "netstandard2.0" 13 | ] 14 | } 15 | ], 16 | "Licenses": [ 17 | { 18 | "Subject": "package", 19 | "Code": "MIT", 20 | "HRef": "https://licenses.nuget.org/MIT" 21 | }, 22 | { 23 | "Subject": "project", 24 | "HRef": "https://github.com/dotnet/corefx" 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.bcl.hashcode/1.1.1/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.bcl.hashcode/1.1.1/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.bcl.hashcode/1.1.1/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.bcl.hashcode/1.1.1/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.codecoverage/17.11.1/readme.md: -------------------------------------------------------------------------------- 1 | Microsoft.CodeCoverage [17.11.1](https://www.nuget.org/packages/Microsoft.CodeCoverage/17.11.1) 2 | -------------------- 3 | 4 | Used by: SqlDatabase internal 5 | 6 | Target frameworks: net472, net6.0, net8.0, net9.0 7 | 8 | License: [MIT](../../../../licenses/mit) 9 | 10 | - package license: [MIT](https://licenses.nuget.org/MIT) 11 | - repository license: [MIT](https://github.com/microsoft/vstest) 12 | - project license: [MIT](https://github.com/microsoft/vstest) 13 | 14 | Description 15 | ----------- 16 | Microsoft.CodeCoverage package brings infra for collecting code coverage from vstest.console.exe and "dotnet test". 17 | 18 | Remarks 19 | ----------- 20 | no remarks 21 | 22 | 23 | Dependencies 0 24 | ----------- 25 | 26 | 27 | *This page was generated by a tool.* -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.codecoverage/17.11.1/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.codecoverage/17.11.1/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.codecoverage/17.11.1/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.codecoverage/17.11.1/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.csharp/4.7.0/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Source": "https://api.nuget.org/v3/index.json", 3 | "License": { 4 | "Code": "MIT", 5 | "Status": "AutomaticallyApproved" 6 | }, 7 | "UsedBy": [ 8 | { 9 | "Name": "SqlDatabase", 10 | "InternalOnly": true, 11 | "TargetFrameworks": [ 12 | "netstandard2.0" 13 | ] 14 | } 15 | ], 16 | "Licenses": [ 17 | { 18 | "Subject": "package", 19 | "Code": "MIT", 20 | "HRef": "https://licenses.nuget.org/MIT" 21 | }, 22 | { 23 | "Subject": "project", 24 | "Code": null, 25 | "HRef": "https://github.com/dotnet/corefx" 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.csharp/4.7.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.csharp/4.7.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.csharp/4.7.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.csharp/4.7.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.extensions.dependencyinjection.abstractions/8.0.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.extensions.dependencyinjection.abstractions/8.0.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.extensions.dependencyinjection.abstractions/8.0.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.extensions.dependencyinjection.abstractions/8.0.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.extensions.logging.abstractions/7.0.1/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.extensions.logging.abstractions/7.0.1/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.extensions.logging.abstractions/7.0.1/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.extensions.logging.abstractions/7.0.1/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.extensions.logging.abstractions/8.0.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.extensions.logging.abstractions/8.0.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.extensions.logging.abstractions/8.0.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.extensions.logging.abstractions/8.0.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.net.test.sdk/17.11.1/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.net.test.sdk/17.11.1/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.net.test.sdk/17.11.1/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.net.test.sdk/17.11.1/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.testplatform.objectmodel/17.11.1/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.testplatform.objectmodel/17.11.1/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.testplatform.objectmodel/17.11.1/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.testplatform.objectmodel/17.11.1/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.testplatform.testhost/17.11.1/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.testplatform.testhost/17.11.1/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.testplatform.testhost/17.11.1/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.testplatform.testhost/17.11.1/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.win32.registry/4.7.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.win32.registry/4.7.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/microsoft.win32.registry/4.7.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/microsoft.win32.registry/4.7.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/moq/4.20.72/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/moq/4.20.72/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/moq/4.20.72/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/moq/4.20.72/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/mysqlconnector/2.3.7/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/mysqlconnector/2.3.7/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/mysqlconnector/2.3.7/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/mysqlconnector/2.3.7/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/netstandard.library/2.0.3/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Source": "https://api.nuget.org/v3/index.json", 3 | "License": { 4 | "Code": "MIT", 5 | "Status": "AutomaticallyApproved" 6 | }, 7 | "UsedBy": [ 8 | { 9 | "Name": "SqlDatabase", 10 | "InternalOnly": false, 11 | "TargetFrameworks": [ 12 | "net472", 13 | "net6.0", 14 | "net8.0", 15 | "net9.0", 16 | "netstandard2.0" 17 | ] 18 | } 19 | ], 20 | "Licenses": [ 21 | { 22 | "Subject": "package", 23 | "Code": "MIT", 24 | "HRef": "https://github.com/dotnet/standard/blob/master/LICENSE.TXT" 25 | }, 26 | { 27 | "Subject": "project", 28 | "HRef": "https://dot.net/", 29 | "Description": "License should be verified on https://dot.net/" 30 | } 31 | ] 32 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/netstandard.library/2.0.3/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/netstandard.library/2.0.3/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/netstandard.library/2.0.3/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/netstandard.library/2.0.3/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/newtonsoft.json/13.0.1/readme.md: -------------------------------------------------------------------------------- 1 | Newtonsoft.Json [13.0.1](https://www.nuget.org/packages/Newtonsoft.Json/13.0.1) 2 | -------------------- 3 | 4 | Used by: SqlDatabase internal 5 | 6 | Target frameworks: net472, net6.0, net8.0, net9.0 7 | 8 | License: [MIT](../../../../licenses/mit) 9 | 10 | - package license: [MIT](https://licenses.nuget.org/MIT) 11 | - repository license: [MIT](https://github.com/JamesNK/Newtonsoft.Json) 12 | - project license: [Unknown](https://www.newtonsoft.com/json) 13 | 14 | Description 15 | ----------- 16 | Json.NET is a popular high-performance JSON framework for .NET 17 | 18 | Remarks 19 | ----------- 20 | no remarks 21 | 22 | 23 | Dependencies 0 24 | ----------- 25 | 26 | 27 | *This page was generated by a tool.* -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/newtonsoft.json/13.0.1/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/newtonsoft.json/13.0.1/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/newtonsoft.json/13.0.1/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/newtonsoft.json/13.0.1/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/newtonsoft.json/13.0.3/readme.md: -------------------------------------------------------------------------------- 1 | Newtonsoft.Json [13.0.3](https://www.nuget.org/packages/Newtonsoft.Json/13.0.3) 2 | -------------------- 3 | 4 | Used by: SqlDatabase internal 5 | 6 | Target frameworks: net472, net6.0, net8.0, net9.0 7 | 8 | License: [MIT](../../../../licenses/mit) 9 | 10 | - package license: [MIT](https://licenses.nuget.org/MIT) 11 | - repository license: [MIT](https://github.com/JamesNK/Newtonsoft.Json) 12 | - project license: [Unknown](https://www.newtonsoft.com/json) 13 | 14 | Description 15 | ----------- 16 | Json.NET is a popular high-performance JSON framework for .NET 17 | 18 | Remarks 19 | ----------- 20 | no remarks 21 | 22 | 23 | Dependencies 0 24 | ----------- 25 | 26 | 27 | *This page was generated by a tool.* -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/newtonsoft.json/13.0.3/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/newtonsoft.json/13.0.3/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/newtonsoft.json/13.0.3/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/newtonsoft.json/13.0.3/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/npgsql/8.0.5/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/npgsql/8.0.5/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/npgsql/8.0.5/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/npgsql/8.0.5/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/nunit/4.2.2/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Source": "https://api.nuget.org/v3/index.json", 3 | "License": { 4 | "Code": "MIT", 5 | "Status": "AutomaticallyApproved" 6 | }, 7 | "UsedBy": [ 8 | { 9 | "Name": "SqlDatabase", 10 | "InternalOnly": true, 11 | "TargetFrameworks": [ 12 | "net472", 13 | "net6.0", 14 | "net8.0", 15 | "net9.0" 16 | ] 17 | } 18 | ], 19 | "Licenses": [ 20 | { 21 | "Subject": "package", 22 | "Code": "MIT", 23 | "HRef": "https://licenses.nuget.org/MIT" 24 | }, 25 | { 26 | "Subject": "repository", 27 | "Code": "MIT", 28 | "HRef": "https://github.com/nunit/nunit" 29 | }, 30 | { 31 | "Subject": "project", 32 | "HRef": "https://nunit.org/" 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/nunit/4.2.2/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/nunit/4.2.2/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/nunit/4.2.2/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/nunit/4.2.2/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/nunit3testadapter/4.6.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/nunit3testadapter/4.6.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/nunit3testadapter/4.6.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/nunit3testadapter/4.6.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/powershellstandard.library/5.1.1/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Source": "https://api.nuget.org/v3/index.json", 3 | "License": { 4 | "Code": "MIT", 5 | "Status": "AutomaticallyApproved" 6 | }, 7 | "UsedBy": [ 8 | { 9 | "Name": "SqlDatabase", 10 | "InternalOnly": false, 11 | "TargetFrameworks": [ 12 | "net472", 13 | "netstandard2.0" 14 | ] 15 | } 16 | ], 17 | "Licenses": [ 18 | { 19 | "Subject": "package", 20 | "Code": "MIT", 21 | "HRef": "https://github.com/PowerShell/PowerShell/blob/master/LICENSE.txt" 22 | }, 23 | { 24 | "Subject": "project", 25 | "Code": "MIT", 26 | "HRef": "https://github.com/PowerShell/PowerShellStandard" 27 | } 28 | ] 29 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/powershellstandard.library/5.1.1/readme.md: -------------------------------------------------------------------------------- 1 | PowerShellStandard.Library [5.1.1](https://www.nuget.org/packages/PowerShellStandard.Library/5.1.1) 2 | -------------------- 3 | 4 | Used by: SqlDatabase 5 | 6 | Target frameworks: net472, netstandard2.0 7 | 8 | License: [MIT](../../../../licenses/mit) 9 | 10 | - package license: [MIT](https://github.com/PowerShell/PowerShell/blob/master/LICENSE.txt) 11 | - project license: [MIT](https://github.com/PowerShell/PowerShellStandard) 12 | 13 | Description 14 | ----------- 15 | Contains the reference assemblies for PowerShell Standard 5 16 | 17 | Remarks 18 | ----------- 19 | no remarks 20 | 21 | 22 | Dependencies 0 23 | ----------- 24 | 25 | 26 | *This page was generated by a tool.* -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/powershellstandard.library/5.1.1/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/powershellstandard.library/5.1.1/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/powershellstandard.library/5.1.1/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/powershellstandard.library/5.1.1/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/shouldly/4.2.1/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/shouldly/4.2.1/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/shouldly/4.2.1/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/shouldly/4.2.1/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/stylecop.analyzers.unstable/1.2.0.556/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Source": "https://api.nuget.org/v3/index.json", 3 | "License": { 4 | "Code": "MIT", 5 | "Status": "AutomaticallyApproved" 6 | }, 7 | "UsedBy": [ 8 | { 9 | "Name": "SqlDatabase", 10 | "InternalOnly": true, 11 | "TargetFrameworks": [ 12 | "net472", 13 | "net6.0", 14 | "net8.0", 15 | "net9.0", 16 | "netstandard2.0" 17 | ] 18 | } 19 | ], 20 | "Licenses": [ 21 | { 22 | "Subject": "package", 23 | "Code": "MIT", 24 | "HRef": "https://licenses.nuget.org/MIT" 25 | }, 26 | { 27 | "Subject": "project", 28 | "Code": "MIT", 29 | "HRef": "https://github.com/DotNetAnalyzers/StyleCopAnalyzers" 30 | } 31 | ] 32 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/stylecop.analyzers.unstable/1.2.0.556/readme.md: -------------------------------------------------------------------------------- 1 | StyleCop.Analyzers.Unstable [1.2.0.556](https://www.nuget.org/packages/StyleCop.Analyzers.Unstable/1.2.0.556) 2 | -------------------- 3 | 4 | Used by: SqlDatabase internal 5 | 6 | Target frameworks: net472, net6.0, net8.0, net9.0, netstandard2.0 7 | 8 | License: [MIT](../../../../licenses/mit) 9 | 10 | - package license: [MIT](https://licenses.nuget.org/MIT) 11 | - project license: [MIT](https://github.com/DotNetAnalyzers/StyleCopAnalyzers) 12 | 13 | Description 14 | ----------- 15 | An implementation of StyleCop's rules using Roslyn analyzers and code fixes 16 | 17 | Remarks 18 | ----------- 19 | no remarks 20 | 21 | 22 | Dependencies 0 23 | ----------- 24 | 25 | 26 | *This page was generated by a tool.* -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/stylecop.analyzers.unstable/1.2.0.556/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/stylecop.analyzers.unstable/1.2.0.556/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/stylecop.analyzers.unstable/1.2.0.556/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/stylecop.analyzers.unstable/1.2.0.556/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.buffers/4.5.1/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Source": "https://api.nuget.org/v3/index.json", 3 | "License": { 4 | "Code": "MIT", 5 | "Status": "AutomaticallyApproved" 6 | }, 7 | "UsedBy": [ 8 | { 9 | "Name": "SqlDatabase", 10 | "InternalOnly": false, 11 | "TargetFrameworks": [ 12 | "net472", 13 | "net6.0", 14 | "net8.0", 15 | "net9.0", 16 | "netstandard2.0" 17 | ] 18 | } 19 | ], 20 | "Licenses": [ 21 | { 22 | "Subject": "package", 23 | "Code": "MIT", 24 | "HRef": "https://github.com/dotnet/corefx/blob/master/LICENSE.TXT" 25 | }, 26 | { 27 | "Subject": "project", 28 | "HRef": "https://dot.net/" 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.buffers/4.5.1/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.buffers/4.5.1/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.buffers/4.5.1/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.buffers/4.5.1/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.codedom/6.0.0/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Source": "https://api.nuget.org/v3/index.json", 3 | "License": { 4 | "Code": "MIT", 5 | "Status": "AutomaticallyApproved" 6 | }, 7 | "UsedBy": [ 8 | { 9 | "Name": "SqlDatabase", 10 | "InternalOnly": true, 11 | "TargetFrameworks": [ 12 | "netstandard2.0" 13 | ] 14 | } 15 | ], 16 | "Licenses": [ 17 | { 18 | "Subject": "package", 19 | "Code": "MIT", 20 | "HRef": "https://licenses.nuget.org/MIT" 21 | }, 22 | { 23 | "Subject": "repository", 24 | "Code": "MIT", 25 | "HRef": "https://github.com/dotnet/runtime" 26 | }, 27 | { 28 | "Subject": "project", 29 | "Code": null, 30 | "HRef": "https://dot.net/" 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.codedom/6.0.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.codedom/6.0.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.codedom/6.0.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.codedom/6.0.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.collections.immutable/8.0.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.collections.immutable/8.0.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.collections.immutable/8.0.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.collections.immutable/8.0.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.data.sqlclient/4.8.6/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.data.sqlclient/4.8.6/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.data.sqlclient/4.8.6/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.data.sqlclient/4.8.6/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.diagnostics.diagnosticsource/4.7.0/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Source": "https://api.nuget.org/v3/index.json", 3 | "License": { 4 | "Code": "MIT", 5 | "Status": "AutomaticallyApproved" 6 | }, 7 | "UsedBy": [ 8 | { 9 | "Name": "SqlDatabase", 10 | "InternalOnly": false, 11 | "TargetFrameworks": [ 12 | "netstandard2.0" 13 | ], 14 | "Dependencies": [ 15 | { 16 | "Name": "System.Memory", 17 | "Version": "4.5.4" 18 | } 19 | ] 20 | } 21 | ], 22 | "Licenses": [ 23 | { 24 | "Subject": "package", 25 | "Code": "MIT", 26 | "HRef": "https://licenses.nuget.org/MIT" 27 | }, 28 | { 29 | "Subject": "project", 30 | "Code": null, 31 | "HRef": "https://github.com/dotnet/corefx" 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.diagnostics.diagnosticsource/4.7.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.diagnostics.diagnosticsource/4.7.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.diagnostics.diagnosticsource/4.7.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.diagnostics.diagnosticsource/4.7.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.diagnostics.diagnosticsource/7.0.2/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.diagnostics.diagnosticsource/7.0.2/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.diagnostics.diagnosticsource/7.0.2/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.diagnostics.diagnosticsource/7.0.2/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.diagnostics.diagnosticsource/8.0.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.diagnostics.diagnosticsource/8.0.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.diagnostics.diagnosticsource/8.0.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.diagnostics.diagnosticsource/8.0.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.diagnostics.eventlog/4.7.0/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Source": "https://api.nuget.org/v3/index.json", 3 | "License": { 4 | "Code": "MIT", 5 | "Status": "AutomaticallyApproved" 6 | }, 7 | "UsedBy": [ 8 | { 9 | "Name": "SqlDatabase", 10 | "InternalOnly": true, 11 | "TargetFrameworks": [ 12 | "netstandard2.0" 13 | ], 14 | "Dependencies": [ 15 | { 16 | "Name": "System.Security.Principal.Windows", 17 | "Version": "4.7.0" 18 | } 19 | ] 20 | } 21 | ], 22 | "Licenses": [ 23 | { 24 | "Subject": "package", 25 | "Code": "MIT", 26 | "HRef": "https://licenses.nuget.org/MIT" 27 | }, 28 | { 29 | "Subject": "project", 30 | "Code": null, 31 | "HRef": "https://github.com/dotnet/corefx" 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.diagnostics.eventlog/4.7.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.diagnostics.eventlog/4.7.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.diagnostics.eventlog/4.7.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.diagnostics.eventlog/4.7.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.management/6.0.1/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.management/6.0.1/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.management/6.0.1/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.management/6.0.1/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.memory/4.5.4/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.memory/4.5.4/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.memory/4.5.4/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.memory/4.5.4/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.memory/4.5.5/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.memory/4.5.5/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.memory/4.5.5/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.memory/4.5.5/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.numerics.vectors/4.4.0/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Source": "https://api.nuget.org/v3/index.json", 3 | "License": { 4 | "Code": "MIT", 5 | "Status": "AutomaticallyApproved" 6 | }, 7 | "UsedBy": [ 8 | { 9 | "Name": "SqlDatabase", 10 | "InternalOnly": false, 11 | "TargetFrameworks": [ 12 | "netstandard2.0" 13 | ] 14 | } 15 | ], 16 | "Licenses": [ 17 | { 18 | "Subject": "package", 19 | "Code": "MIT", 20 | "HRef": "https://github.com/dotnet/corefx/blob/master/LICENSE.TXT" 21 | }, 22 | { 23 | "Subject": "project", 24 | "Code": null, 25 | "HRef": "https://dot.net/" 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.numerics.vectors/4.4.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.numerics.vectors/4.4.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.numerics.vectors/4.4.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.numerics.vectors/4.4.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.numerics.vectors/4.5.0/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Source": "https://api.nuget.org/v3/index.json", 3 | "License": { 4 | "Code": "MIT", 5 | "Status": "AutomaticallyApproved" 6 | }, 7 | "UsedBy": [ 8 | { 9 | "Name": "SqlDatabase", 10 | "InternalOnly": true, 11 | "TargetFrameworks": [ 12 | "net472", 13 | "net6.0", 14 | "net8.0", 15 | "net9.0" 16 | ] 17 | } 18 | ], 19 | "Licenses": [ 20 | { 21 | "Subject": "package", 22 | "Code": "MIT", 23 | "HRef": "https://github.com/dotnet/corefx/blob/master/LICENSE.TXT" 24 | }, 25 | { 26 | "Subject": "project", 27 | "HRef": "https://dot.net/" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.numerics.vectors/4.5.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.numerics.vectors/4.5.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.numerics.vectors/4.5.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.numerics.vectors/4.5.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.reflection.emit.ilgeneration/4.7.0/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Source": "https://api.nuget.org/v3/index.json", 3 | "License": { 4 | "Code": "MIT", 5 | "Status": "AutomaticallyApproved" 6 | }, 7 | "UsedBy": [ 8 | { 9 | "Name": "SqlDatabase", 10 | "InternalOnly": true, 11 | "TargetFrameworks": [ 12 | "netstandard2.0" 13 | ] 14 | } 15 | ], 16 | "Licenses": [ 17 | { 18 | "Subject": "package", 19 | "Code": "MIT", 20 | "HRef": "https://licenses.nuget.org/MIT" 21 | }, 22 | { 23 | "Subject": "project", 24 | "Code": null, 25 | "HRef": "https://github.com/dotnet/corefx" 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.reflection.emit.ilgeneration/4.7.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.reflection.emit.ilgeneration/4.7.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.reflection.emit.ilgeneration/4.7.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.reflection.emit.ilgeneration/4.7.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.reflection.emit/4.7.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.reflection.emit/4.7.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.reflection.emit/4.7.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.reflection.emit/4.7.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.reflection.metadata/1.6.0/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Source": "https://api.nuget.org/v3/index.json", 3 | "License": { 4 | "Code": "MIT", 5 | "Status": "AutomaticallyApproved" 6 | }, 7 | "UsedBy": [ 8 | { 9 | "Name": "SqlDatabase", 10 | "InternalOnly": true, 11 | "TargetFrameworks": [ 12 | "net472", 13 | "net6.0", 14 | "net8.0", 15 | "net9.0" 16 | ] 17 | } 18 | ], 19 | "Licenses": [ 20 | { 21 | "Subject": "package", 22 | "Code": "MIT", 23 | "HRef": "https://github.com/dotnet/corefx/blob/master/LICENSE.TXT" 24 | }, 25 | { 26 | "Subject": "project", 27 | "HRef": "https://dot.net/", 28 | "Description": "License should be verified on https://dot.net/" 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.reflection.metadata/1.6.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.reflection.metadata/1.6.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.reflection.metadata/1.6.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.reflection.metadata/1.6.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.runtime.compilerservices.unsafe/4.5.3/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Source": "https://api.nuget.org/v3/index.json", 3 | "License": { 4 | "Code": "MIT", 5 | "Status": "AutomaticallyApproved" 6 | }, 7 | "UsedBy": [ 8 | { 9 | "Name": "SqlDatabase", 10 | "InternalOnly": true, 11 | "TargetFrameworks": [ 12 | "net472", 13 | "net6.0", 14 | "net8.0", 15 | "net9.0", 16 | "netstandard2.0" 17 | ] 18 | } 19 | ], 20 | "Licenses": [ 21 | { 22 | "Subject": "package", 23 | "Code": "MIT", 24 | "HRef": "https://github.com/dotnet/corefx/blob/master/LICENSE.TXT" 25 | }, 26 | { 27 | "Subject": "project", 28 | "HRef": "https://dot.net/" 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.runtime.compilerservices.unsafe/4.5.3/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.runtime.compilerservices.unsafe/4.5.3/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.runtime.compilerservices.unsafe/4.5.3/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.runtime.compilerservices.unsafe/4.5.3/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.runtime.compilerservices.unsafe/4.7.0/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Source": "https://api.nuget.org/v3/index.json", 3 | "License": { 4 | "Code": "MIT", 5 | "Status": "AutomaticallyApproved" 6 | }, 7 | "UsedBy": [ 8 | { 9 | "Name": "SqlDatabase", 10 | "InternalOnly": false, 11 | "TargetFrameworks": [ 12 | "netstandard2.0" 13 | ] 14 | } 15 | ], 16 | "Licenses": [ 17 | { 18 | "Subject": "package", 19 | "Code": "MIT", 20 | "HRef": "https://licenses.nuget.org/MIT" 21 | }, 22 | { 23 | "Subject": "project", 24 | "Code": null, 25 | "HRef": "https://github.com/dotnet/corefx" 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.runtime.compilerservices.unsafe/4.7.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.runtime.compilerservices.unsafe/4.7.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.runtime.compilerservices.unsafe/4.7.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.runtime.compilerservices.unsafe/4.7.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.runtime.compilerservices.unsafe/6.0.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.runtime.compilerservices.unsafe/6.0.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.runtime.compilerservices.unsafe/6.0.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.runtime.compilerservices.unsafe/6.0.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.runtime.loader/4.3.0/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Source": "https://api.nuget.org/v3/index.json", 3 | "License": { 4 | "Code": "ms-net-library", 5 | "Status": "AutomaticallyApproved" 6 | }, 7 | "UsedBy": [ 8 | { 9 | "Name": "SqlDatabase", 10 | "InternalOnly": false, 11 | "TargetFrameworks": [ 12 | "netstandard2.0" 13 | ] 14 | } 15 | ], 16 | "Licenses": [ 17 | { 18 | "Subject": "package", 19 | "Code": "ms-net-library", 20 | "HRef": "http://go.microsoft.com/fwlink/?LinkId=329770" 21 | }, 22 | { 23 | "Subject": "project", 24 | "Code": null, 25 | "HRef": "https://dot.net/" 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.runtime.loader/4.3.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.runtime.loader/4.3.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.runtime.loader/4.3.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.runtime.loader/4.3.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.security.accesscontrol/4.7.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.security.accesscontrol/4.7.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.security.accesscontrol/4.7.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.security.accesscontrol/4.7.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.security.principal.windows/4.7.0/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Source": "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\", 3 | "License": { 4 | "Code": "MIT", 5 | "Status": "AutomaticallyApproved" 6 | }, 7 | "UsedBy": [ 8 | { 9 | "Name": "SqlDatabase", 10 | "InternalOnly": false, 11 | "TargetFrameworks": [ 12 | "net472", 13 | "net6.0", 14 | "net8.0", 15 | "net9.0", 16 | "netstandard2.0" 17 | ] 18 | } 19 | ], 20 | "Licenses": [ 21 | { 22 | "Subject": "package", 23 | "Code": "MIT", 24 | "HRef": "https://licenses.nuget.org/MIT" 25 | }, 26 | { 27 | "Subject": "project", 28 | "HRef": "https://github.com/dotnet/corefx" 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.security.principal.windows/4.7.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.security.principal.windows/4.7.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.security.principal.windows/4.7.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.security.principal.windows/4.7.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.text.encoding.codepages/4.7.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.text.encoding.codepages/4.7.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.text.encoding.codepages/4.7.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.text.encoding.codepages/4.7.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.text.encodings.web/8.0.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.text.encodings.web/8.0.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.text.encodings.web/8.0.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.text.encodings.web/8.0.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.text.json/8.0.5/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.text.json/8.0.5/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.text.json/8.0.5/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.text.json/8.0.5/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.threading.channels/8.0.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.threading.channels/8.0.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.threading.channels/8.0.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.threading.channels/8.0.0/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.threading.tasks.extensions/4.5.4/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.threading.tasks.extensions/4.5.4/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.threading.tasks.extensions/4.5.4/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.threading.tasks.extensions/4.5.4/third-party-notices.txt -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.valuetuple/4.5.0/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "Source": "https://api.nuget.org/v3/index.json", 3 | "License": { 4 | "Code": "MIT", 5 | "Status": "AutomaticallyApproved" 6 | }, 7 | "UsedBy": [ 8 | { 9 | "Name": "SqlDatabase", 10 | "InternalOnly": true, 11 | "TargetFrameworks": [ 12 | "net472", 13 | "net6.0", 14 | "net8.0", 15 | "net9.0" 16 | ] 17 | } 18 | ], 19 | "Licenses": [ 20 | { 21 | "Subject": "package", 22 | "Code": "MIT", 23 | "HRef": "https://github.com/dotnet/corefx/blob/master/LICENSE.TXT" 24 | }, 25 | { 26 | "Subject": "project", 27 | "HRef": "https://dot.net/" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.valuetuple/4.5.0/remarks.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.valuetuple/4.5.0/remarks.md -------------------------------------------------------------------------------- /Build/third-party-libraries/packages/nuget.org/system.valuetuple/4.5.0/third-party-notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Build/third-party-libraries/packages/nuget.org/system.valuetuple/4.5.0/third-party-notices.txt -------------------------------------------------------------------------------- /Examples/CSharpMirationStep/CSharpMirationStep.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net472 5 | 2.1_2.2 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Examples/CreateDatabaseFolder/01_database/01_DropExisting.sql: -------------------------------------------------------------------------------- 1 | USE master 2 | GO 3 | 4 | EXEC msdb.dbo.sp_delete_database_backuphistory @database_name = N'{{DatabaseName}}' 5 | GO 6 | 7 | IF EXISTS(SELECT * FROM sys.databases WHERE Name=N'{{DatabaseName}}') BEGIN 8 | ALTER DATABASE [{{DatabaseName}}] SET SINGLE_USER WITH ROLLBACK IMMEDIATE 9 | END 10 | GO 11 | 12 | IF EXISTS(SELECT * FROM sys.databases WHERE Name=N'{{DatabaseName}}') BEGIN 13 | DROP DATABASE [{{DatabaseName}}] 14 | END 15 | GO -------------------------------------------------------------------------------- /Examples/CreateDatabaseFolder/01_database/02_Create.sql: -------------------------------------------------------------------------------- 1 | USE master 2 | GO 3 | 4 | CREATE DATABASE [{{DatabaseName}}] 5 | GO 6 | 7 | ALTER DATABASE [{{DatabaseName}}] SET RECOVERY SIMPLE WITH NO_WAIT 8 | GO 9 | 10 | ALTER DATABASE [{{DatabaseName}}] SET ALLOW_SNAPSHOT_ISOLATION ON 11 | GO 12 | -------------------------------------------------------------------------------- /Examples/CreateDatabaseFolder/01_database/03_Version.sql: -------------------------------------------------------------------------------- 1 | USE [{{DatabaseName}}] 2 | GO 3 | 4 | EXEC sys.sp_addextendedproperty @name=N'version', @value=N'1.0' 5 | GO 6 | -------------------------------------------------------------------------------- /Examples/CreateDatabaseFolder/02_schemas/01_demo.sql: -------------------------------------------------------------------------------- 1 | CREATE SCHEMA demo 2 | GO 3 | 4 | -------------------------------------------------------------------------------- /Examples/CreateDatabaseFolder/03_tables/01_demo.Department.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE demo.Department 2 | ( 3 | Id INT NOT NULL IDENTITY(1, 1) 4 | ,Name NVARCHAR(300) NOT NULL 5 | ) 6 | GO 7 | 8 | ALTER TABLE demo.Department ADD CONSTRAINT PK_Department PRIMARY KEY CLUSTERED (Id) 9 | GO 10 | 11 | CREATE NONCLUSTERED INDEX IX_Department_Name ON demo.Department (Name) 12 | GO 13 | -------------------------------------------------------------------------------- /Examples/CreateDatabaseFolder/03_tables/02_demo.Employee.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE demo.Employee 2 | ( 3 | Id INT NOT NULL IDENTITY(1, 1) 4 | ,FullName NVARCHAR(300) NOT NULL 5 | ,DepartmentId INT NOT NULL 6 | ) 7 | GO 8 | 9 | ALTER TABLE demo.Employee ADD CONSTRAINT PK_Employee PRIMARY KEY CLUSTERED (Id) 10 | GO 11 | 12 | CREATE NONCLUSTERED INDEX IX_Employee_DepartmentId ON demo.Employee (DepartmentId) 13 | GO 14 | 15 | CREATE NONCLUSTERED INDEX IX_Employee_FullName ON demo.Employee (FullName) 16 | GO 17 | 18 | ALTER TABLE demo.Employee ADD CONSTRAINT FK_Employee_Department 19 | FOREIGN KEY (DepartmentId) 20 | REFERENCES demo.Department (Id) 21 | ON UPDATE NO ACTION 22 | ON DELETE NO ACTION 23 | GO 24 | -------------------------------------------------------------------------------- /Examples/CreateDatabaseFolder/05_data/01_staff.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO demo.Department(Name) 2 | VALUES (N'HR'), (N'Dev'), (N'Test'), (N'S&S') 3 | GO 4 | 5 | WITH employee AS 6 | ( 7 | SELECT N'' FullName, N'' Department WHERE 1=0 8 | UNION ALL 9 | SELECT N'Anna', N'HR' 10 | UNION ALL 11 | SELECT N'David', N'DEV' 12 | UNION ALL 13 | SELECT N'Georg', N'Test' 14 | UNION ALL 15 | SELECT N'Ivan', N'S&S' 16 | ) 17 | 18 | INSERT INTO demo.Employee(FullName, DepartmentId) 19 | SELECT employee.FullName 20 | ,Department.Id 21 | FROM employee 22 | LEFT JOIN demo.Department Department ON employee.Department = Department.Name 23 | GO -------------------------------------------------------------------------------- /Examples/ExecuteScriptsFolder/01_demo.sql: -------------------------------------------------------------------------------- 1 | CREATE SCHEMA demo 2 | GO 3 | 4 | -------------------------------------------------------------------------------- /Examples/ExecuteScriptsFolder/02_demo.Department.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE demo.Department 2 | ( 3 | Id INT NOT NULL IDENTITY(1, 1) 4 | ,Name NVARCHAR(300) NOT NULL 5 | ) 6 | GO 7 | 8 | ALTER TABLE demo.Department ADD CONSTRAINT PK_Department PRIMARY KEY CLUSTERED (Id) 9 | GO 10 | 11 | CREATE NONCLUSTERED INDEX IX_Department_Name ON demo.Department (Name) 12 | GO 13 | -------------------------------------------------------------------------------- /Examples/ExecuteScriptsFolder/03_demo.Employee.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE demo.Employee 2 | ( 3 | Id INT NOT NULL IDENTITY(1, 1) 4 | ,FullName NVARCHAR(300) NOT NULL 5 | ,DepartmentId INT NOT NULL 6 | ) 7 | GO 8 | 9 | ALTER TABLE demo.Employee ADD CONSTRAINT PK_Employee PRIMARY KEY CLUSTERED (Id) 10 | GO 11 | 12 | CREATE NONCLUSTERED INDEX IX_Employee_DepartmentId ON demo.Employee (DepartmentId) 13 | GO 14 | 15 | CREATE NONCLUSTERED INDEX IX_Employee_FullName ON demo.Employee (FullName) 16 | GO 17 | 18 | ALTER TABLE demo.Employee ADD CONSTRAINT FK_Employee_Department 19 | FOREIGN KEY (DepartmentId) 20 | REFERENCES demo.Department (Id) 21 | ON UPDATE NO ACTION 22 | ON DELETE NO ACTION 23 | GO 24 | -------------------------------------------------------------------------------- /Examples/ExecuteScriptsFolder/data/01_staff.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO demo.Department(Name) 2 | VALUES (N'HR'), (N'Dev'), (N'Test'), (N'S&S') 3 | GO 4 | 5 | WITH employee AS 6 | ( 7 | SELECT N'' FullName, N'' Department WHERE 1=0 8 | UNION ALL 9 | SELECT N'Anna', N'HR' 10 | UNION ALL 11 | SELECT N'David', N'DEV' 12 | UNION ALL 13 | SELECT N'Georg', N'Test' 14 | UNION ALL 15 | SELECT N'Ivan', N'S&S' 16 | ) 17 | 18 | INSERT INTO demo.Employee(FullName, DepartmentId) 19 | SELECT employee.FullName 20 | ,Department.Id 21 | FROM employee 22 | LEFT JOIN demo.Department Department ON employee.Department = Department.Name 23 | GO -------------------------------------------------------------------------------- /Examples/MigrationStepsFolder/Modularity/book_1.0_2.0.sql: -------------------------------------------------------------------------------- 1 | /* 2 | * module dependency: person 2.0 3 | */ 4 | GO 5 | 6 | CREATE TABLE dbo.Book 7 | ( 8 | Id INT NOT NULL IDENTITY(1, 1) 9 | ,AuthorId INT NOT NULL 10 | ,Name NVARCHAR(250) NOT NULL 11 | ) 12 | 13 | ALTER TABLE dbo.Book ADD CONSTRAINT PK_dbo_Book PRIMARY KEY CLUSTERED (Id) 14 | GO 15 | 16 | ALTER TABLE dbo.Book ADD CONSTRAINT FK_Book_AuthorId FOREIGN KEY (AuthorId) REFERENCES dbo.Person (Id) 17 | GO -------------------------------------------------------------------------------- /Examples/MigrationStepsFolder/Modularity/person_1.0_2.0.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE dbo.Person 2 | ( 3 | Id INT NOT NULL IDENTITY(1, 1) 4 | ,Name NVARCHAR(250) NOT NULL 5 | ) 6 | 7 | ALTER TABLE dbo.Person ADD CONSTRAINT PK_dbo_Person PRIMARY KEY CLUSTERED (Id) 8 | GO 9 | -------------------------------------------------------------------------------- /Examples/MigrationStepsFolder/Modularity/reader_1.0_2.0.sql: -------------------------------------------------------------------------------- 1 | /* 2 | * module dependency: person 1.0 3 | * module dependency: book 1.0 4 | */ 5 | GO 6 | 7 | CREATE TABLE dbo.BookComment 8 | ( 9 | Id INT NOT NULL IDENTITY(1, 1) 10 | ,ReaderId INT NOT NULL 11 | ,BookId INT NOT NULL 12 | ,Comment NVARCHAR(MAX) NOT NULL 13 | ) 14 | 15 | ALTER TABLE dbo.BookComment ADD CONSTRAINT PK_dbo_BookComment PRIMARY KEY CLUSTERED (Id) 16 | GO 17 | 18 | ALTER TABLE dbo.BookComment ADD CONSTRAINT FK_Book_ReaderId FOREIGN KEY (ReaderId) REFERENCES dbo.Person (Id) 19 | GO 20 | 21 | ALTER TABLE dbo.BookComment ADD CONSTRAINT FK_Book_BookId FOREIGN KEY (BookId) REFERENCES dbo.Book (Id) 22 | GO -------------------------------------------------------------------------------- /Examples/MigrationStepsFolder/StraightForward/1.0_1.1.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE dbo.Person 2 | ( 3 | Id INT NOT NULL IDENTITY(1, 1) 4 | ,Name NVARCHAR(250) NOT NULL 5 | ) 6 | 7 | ALTER TABLE dbo.Person ADD CONSTRAINT PK_dbo_Person PRIMARY KEY CLUSTERED (Id) 8 | GO 9 | -------------------------------------------------------------------------------- /Examples/MigrationStepsFolder/StraightForward/1.1_2.0.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE dbo.Book 2 | ( 3 | Id INT NOT NULL IDENTITY(1, 1) 4 | ,AuthorId INT NOT NULL 5 | ,Name NVARCHAR(250) NOT NULL 6 | ) 7 | 8 | ALTER TABLE dbo.Book ADD CONSTRAINT PK_dbo_Book PRIMARY KEY CLUSTERED (Id) 9 | GO 10 | 11 | ALTER TABLE dbo.Book ADD CONSTRAINT FK_Book_AuthorId FOREIGN KEY (AuthorId) REFERENCES dbo.Person (Id) 12 | GO -------------------------------------------------------------------------------- /Examples/MigrationStepsFolder/StraightForward/2.0_3.0.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE dbo.BookComment 2 | ( 3 | Id INT NOT NULL IDENTITY(1, 1) 4 | ,ReaderId INT NOT NULL 5 | ,BookId INT NOT NULL 6 | ,Comment NVARCHAR(MAX) NOT NULL 7 | ) 8 | 9 | ALTER TABLE dbo.BookComment ADD CONSTRAINT PK_dbo_BookComment PRIMARY KEY CLUSTERED (Id) 10 | GO 11 | 12 | ALTER TABLE dbo.BookComment ADD CONSTRAINT FK_Book_ReaderId FOREIGN KEY (ReaderId) REFERENCES dbo.Person (Id) 13 | GO 14 | 15 | ALTER TABLE dbo.BookComment ADD CONSTRAINT FK_Book_BookId FOREIGN KEY (BookId) REFERENCES dbo.Book (Id) 16 | GO -------------------------------------------------------------------------------- /Examples/PackageManagerConsole/SolutionScripts/SolutionScripts.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net472 4 | false 5 | true 6 | AnyCPU 7 | 8 | false 9 | Demo.SolutionScripts 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Examples/PackageManagerConsole/SolutionScripts/SqlDatabase.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | -------------------------------------------------------------------------------- /Examples/PackageManagerConsole/SomeApp/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /Examples/PackageManagerConsole/SomeApp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SomeApp; 4 | 5 | public static class Program 6 | { 7 | public static void Main(string[] args) 8 | { 9 | Console.WriteLine("Hello World!"); 10 | } 11 | } -------------------------------------------------------------------------------- /Examples/PackageManagerConsole/SomeApp/SomeApp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | true 6 | AnyCPU 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Examples/PackageManagerConsole/Sreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Examples/PackageManagerConsole/Sreen.png -------------------------------------------------------------------------------- /Examples/PowerShellScript/example.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding(SupportsShouldProcess=$true)] # indicates that the script implementation supports -WhatIf scenario 2 | param ( 3 | $Command, # instance of SqlCommand, $null in case -WhatIf 4 | $Variables # access to variables 5 | ) 6 | 7 | if (-not $Variables.TableName) { 8 | throw "Variable TableName is not defined." 9 | } 10 | 11 | if ($WhatIfPreference) { 12 | # handle -WhatIf scenario 13 | return 14 | } 15 | 16 | Write-Information "start execution" 17 | 18 | $Command.CommandText = ("print 'current database name is {0}'" -f $Variables.DatabaseName) 19 | $Command.ExecuteNonQuery() 20 | 21 | $Command.CommandText = ("drop table {0}" -f $Variables.TableName) 22 | $Command.ExecuteNonQuery() 23 | 24 | Write-Information "finish execution" -------------------------------------------------------------------------------- /Examples/SqlServerDockerImage/create-database-build-image.ps1: -------------------------------------------------------------------------------- 1 | # build image 2 | docker build ` 3 | -f create-database.dockerfile ` 4 | -t sqldatabase/mssql-server-linux-demo:create ` 5 | . 6 | -------------------------------------------------------------------------------- /Examples/SqlServerDockerImage/create-database-scripts/01_database/01_DropExisting.sql: -------------------------------------------------------------------------------- 1 | USE master 2 | GO 3 | 4 | EXEC msdb.dbo.sp_delete_database_backuphistory @database_name = N'{{DatabaseName}}' 5 | GO 6 | 7 | IF EXISTS(SELECT * FROM sys.databases WHERE Name=N'{{DatabaseName}}') BEGIN 8 | ALTER DATABASE [{{DatabaseName}}] SET SINGLE_USER WITH ROLLBACK IMMEDIATE 9 | END 10 | GO 11 | 12 | IF EXISTS(SELECT * FROM sys.databases WHERE Name=N'{{DatabaseName}}') BEGIN 13 | DROP DATABASE [{{DatabaseName}}] 14 | END 15 | GO -------------------------------------------------------------------------------- /Examples/SqlServerDockerImage/create-database-scripts/01_database/02_Create.sql: -------------------------------------------------------------------------------- 1 | USE master 2 | GO 3 | 4 | CREATE DATABASE [{{DatabaseName}}] 5 | GO 6 | 7 | ALTER DATABASE [{{DatabaseName}}] SET RECOVERY SIMPLE WITH NO_WAIT 8 | GO 9 | 10 | ALTER DATABASE [{{DatabaseName}}] SET ALLOW_SNAPSHOT_ISOLATION ON 11 | GO 12 | -------------------------------------------------------------------------------- /Examples/SqlServerDockerImage/create-database-scripts/01_database/03_Version.sql: -------------------------------------------------------------------------------- 1 | USE [{{DatabaseName}}] 2 | GO 3 | 4 | EXEC sys.sp_addextendedproperty @name=N'version', @value=N'1.0' 5 | GO 6 | -------------------------------------------------------------------------------- /Examples/SqlServerDockerImage/create-database-scripts/02_schemas/01_demo.sql: -------------------------------------------------------------------------------- 1 | CREATE SCHEMA demo 2 | GO 3 | 4 | -------------------------------------------------------------------------------- /Examples/SqlServerDockerImage/create-database-scripts/03_tables/01_demo.Department.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE demo.Department 2 | ( 3 | Id INT NOT NULL IDENTITY(1, 1) 4 | ,Name NVARCHAR(300) NOT NULL 5 | ) 6 | GO 7 | 8 | ALTER TABLE demo.Department ADD CONSTRAINT PK_Department PRIMARY KEY CLUSTERED (Id) 9 | GO 10 | 11 | CREATE NONCLUSTERED INDEX IX_Department_Name ON demo.Department (Name) 12 | GO 13 | -------------------------------------------------------------------------------- /Examples/SqlServerDockerImage/create-database-scripts/03_tables/02_demo.Employee.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE demo.Employee 2 | ( 3 | Id INT NOT NULL IDENTITY(1, 1) 4 | ,FullName NVARCHAR(300) NOT NULL 5 | ,DepartmentId INT NOT NULL 6 | ) 7 | GO 8 | 9 | ALTER TABLE demo.Employee ADD CONSTRAINT PK_Employee PRIMARY KEY CLUSTERED (Id) 10 | GO 11 | 12 | CREATE NONCLUSTERED INDEX IX_Employee_DepartmentId ON demo.Employee (DepartmentId) 13 | GO 14 | 15 | CREATE NONCLUSTERED INDEX IX_Employee_FullName ON demo.Employee (FullName) 16 | GO 17 | 18 | ALTER TABLE demo.Employee ADD CONSTRAINT FK_Employee_Department 19 | FOREIGN KEY (DepartmentId) 20 | REFERENCES demo.Department (Id) 21 | ON UPDATE NO ACTION 22 | ON DELETE NO ACTION 23 | GO 24 | -------------------------------------------------------------------------------- /Examples/SqlServerDockerImage/create-database-scripts/05_data/01_staff.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO demo.Department(Name) 2 | VALUES (N'HR'), (N'Dev'), (N'Test'), (N'S&S') 3 | GO 4 | 5 | WITH employee AS 6 | ( 7 | SELECT N'' FullName, N'' Department WHERE 1=0 8 | UNION ALL 9 | SELECT N'Anna', N'HR' 10 | UNION ALL 11 | SELECT N'David', N'DEV' 12 | UNION ALL 13 | SELECT N'Georg', N'Test' 14 | UNION ALL 15 | SELECT N'Ivan', N'S&S' 16 | ) 17 | 18 | INSERT INTO demo.Employee(FullName, DepartmentId) 19 | SELECT employee.FullName 20 | ,Department.Id 21 | FROM employee 22 | LEFT JOIN demo.Department Department ON employee.Department = Department.Name 23 | GO -------------------------------------------------------------------------------- /Examples/SqlServerDockerImage/upgrade-database-build-image.ps1: -------------------------------------------------------------------------------- 1 | # build image 2 | docker build ` 3 | -f upgrade-database-scripts.dockerfile ` 4 | -t sqldatabase/mssql-server-linux-demo:upgrade ` 5 | . 6 | -------------------------------------------------------------------------------- /Examples/SqlServerDockerImage/upgrade-database-scripts/1.0_1.1.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE demo.Employee ADD Birthday DATETIME2 NULL 2 | GO 3 | 4 | UPDATE demo.Employee 5 | SET Birthday = DATEADD(year, -20, GETDATE()) 6 | WHERE FullName = 'Anna' 7 | 8 | UPDATE demo.Employee 9 | SET Birthday = DATEADD(year, -22, GETDATE()) 10 | WHERE FullName = 'David' 11 | 12 | UPDATE demo.Employee 13 | SET Birthday = DATEADD(year, -30, GETDATE()) 14 | WHERE FullName = 'Georg' 15 | 16 | UPDATE demo.Employee 17 | SET Birthday = DATEADD(year, -40, GETDATE()) 18 | WHERE FullName = 'Ivan' 19 | GO 20 | 21 | ALTER TABLE demo.Employee ALTER COLUMN Birthday DATETIME2 NULL -------------------------------------------------------------------------------- /Examples/SqlServerDockerImage/upgrade-database-scripts/1.1_2.0.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE demo.Employee ADD ManagerId INT NULL 2 | GO 3 | 4 | ALTER TABLE demo.Employee ADD CONSTRAINT FK_demo_Employee_ManagerId FOREIGN KEY (ManagerId) REFERENCES demo.Employee (Id) 5 | GO 6 | 7 | CREATE NONCLUSTERED INDEX IX_Employee_ManagerId ON demo.Employee (ManagerId) 8 | GO 9 | -------------------------------------------------------------------------------- /Sources/Docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | mssql: 4 | image: sqldatabase/mssql:2017 5 | restart: always 6 | ports: 7 | - 1433:1433 8 | 9 | pgsql: 10 | image: sqldatabase/postgres:13.3 11 | restart: always 12 | ports: 13 | - 5432:5432 14 | 15 | mysql: 16 | image: sqldatabase/mysql:8.0.25 17 | restart: always 18 | ports: 19 | - 3306:3306 20 | -------------------------------------------------------------------------------- /Sources/Docker/image-dotnet-runtime-6.0.dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/runtime:6.0 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y liblttng-ust0 curl && \ 5 | curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.2.24/powershell_7.2.24-1.deb_amd64.deb --output powershell.deb && \ 6 | dpkg -i powershell.deb && \ 7 | apt-get install -f && \ 8 | rm -f powershell.deb -------------------------------------------------------------------------------- /Sources/Docker/image-dotnet-runtime-8.0.dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/runtime:8.0 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y curl && \ 5 | curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.4.6/powershell_7.4.6-1.deb_amd64.deb --output powershell.deb && \ 6 | dpkg -i powershell.deb && \ 7 | apt-get install -f && \ 8 | rm -f powershell.deb -------------------------------------------------------------------------------- /Sources/Docker/image-dotnet-runtime-9.0.dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/runtime:9.0 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y curl && \ 5 | curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.5.0-preview.5/powershell-preview_7.5.0-preview.5-1.deb_amd64.deb --output powershell.deb && \ 6 | dpkg -i powershell.deb && \ 7 | apt-get install -f && \ 8 | rm -f powershell.deb -------------------------------------------------------------------------------- /Sources/Docker/image-dotnet-sdk-6.0.dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/sdk:6.0 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y liblttng-ust0 && \ 5 | curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.2.24/powershell_7.2.24-1.deb_amd64.deb --output powershell.deb && \ 6 | dpkg -i powershell.deb && \ 7 | apt-get install -f && \ 8 | rm -f powershell.deb -------------------------------------------------------------------------------- /Sources/Docker/image-dotnet-sdk-8.0.dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/sdk:8.0 2 | 3 | RUN apt-get update && \ 4 | curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.4.6/powershell_7.4.6-1.deb_amd64.deb --output powershell.deb && \ 5 | dpkg -i powershell.deb && \ 6 | apt-get install -f && \ 7 | rm -f powershell.deb -------------------------------------------------------------------------------- /Sources/Docker/image-dotnet-sdk-9.0.dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/sdk:9.0 2 | 3 | RUN apt-get update && \ 4 | curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.5.0-preview.5/powershell-preview_7.5.0-preview.5-1.deb_amd64.deb --output powershell.deb && \ 5 | dpkg -i powershell.deb && \ 6 | apt-get install -f && \ 7 | rm -f powershell.deb -------------------------------------------------------------------------------- /Sources/Docker/image-mssql-2017.dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/mssql/server:2017-latest AS build 2 | 3 | ENV ACCEPT_EULA=Y \ 4 | SA_PASSWORD=P@ssw0rd \ 5 | MSSQL_PID=Express 6 | 7 | COPY mssql.create-database.sql /db/ 8 | 9 | RUN /opt/mssql/bin/sqlservr & \ 10 | sleep 20 && \ 11 | /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P P@ssw0rd -l 300 -i /db/mssql.create-database.sql && \ 12 | ls /var/opt/mssql/data/ && \ 13 | pkill sqlservr 14 | 15 | FROM mcr.microsoft.com/mssql/server:2017-latest AS runtime 16 | 17 | ENV ACCEPT_EULA=Y \ 18 | SA_PASSWORD=P@ssw0rd \ 19 | MSSQL_PID=Express 20 | 21 | COPY --from=build /var/opt/mssql/data/* /var/opt/mssql/data/ -------------------------------------------------------------------------------- /Sources/Docker/image-mysql-8025.dockerfile: -------------------------------------------------------------------------------- 1 | FROM mysql:8.0.25 2 | 3 | ENV MYSQL_ROOT_PASSWORD=qwerty 4 | 5 | COPY mysql.create-database.sql /docker-entrypoint-initdb.d/ -------------------------------------------------------------------------------- /Sources/Docker/image-postgres-133.dockerfile: -------------------------------------------------------------------------------- 1 | FROM postgres:13.3-alpine 2 | 3 | ENV POSTGRES_PASSWORD=qwerty 4 | 5 | COPY pgsql.create-database.sql /docker-entrypoint-initdb.d/ -------------------------------------------------------------------------------- /Sources/Docker/mssql.create-database.sql: -------------------------------------------------------------------------------- 1 | USE master 2 | GO 3 | 4 | EXEC sys.sp_configure N'show advanced options', N'1' RECONFIGURE WITH OVERRIDE 5 | GO 6 | EXEC sys.sp_configure N'max server memory (MB)', N'512' 7 | GO 8 | RECONFIGURE WITH OVERRIDE 9 | GO 10 | EXEC sys.sp_configure N'show advanced options', N'0' RECONFIGURE WITH OVERRIDE 11 | GO 12 | 13 | PRINT 'create database...' 14 | CREATE DATABASE SqlDatabaseTest 15 | GO 16 | 17 | PRINT 'change recovery model...' 18 | ALTER DATABASE SqlDatabaseTest SET RECOVERY SIMPLE WITH NO_WAIT 19 | GO 20 | 21 | PRINT 'set database version...' 22 | EXEC SqlDatabaseTest.sys.sp_addextendedproperty @name=N'version', @value=N'1.0' 23 | GO 24 | 25 | PRINT 'set module version...' 26 | EXEC SqlDatabaseTest.sys.sp_addextendedproperty @name=N'version-SomeModuleName', @value=N'2.0' 27 | GO -------------------------------------------------------------------------------- /Sources/Docker/mysql.create-database.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE sqldatabasetest; 2 | 3 | USE sqldatabasetest; 4 | 5 | CREATE TABLE version 6 | ( 7 | module_name varchar(20) NOT NULL 8 | ,version varchar(20) NOT NULL 9 | ); 10 | 11 | ALTER TABLE version 12 | ADD CONSTRAINT pk_version PRIMARY KEY (module_name); 13 | 14 | INSERT INTO version (module_name, version) VALUES 15 | ('database', '1.0') 16 | ,('SomeModuleName', '2.0'); 17 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MsSql/Execute/drop.database.sql: -------------------------------------------------------------------------------- 1 | USE master 2 | GO 3 | 4 | EXEC msdb.dbo.sp_delete_database_backuphistory @database_name = N'{{DbName}}' 5 | GO 6 | 7 | ALTER DATABASE [{{DbName}}] SET SINGLE_USER WITH ROLLBACK IMMEDIATE 8 | GO 9 | 10 | PRINT 'drop {{DbName}}' 11 | DROP DATABASE [{{DbName}}] 12 | GO 13 | 14 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MsSql/Export/export.sql: -------------------------------------------------------------------------------- 1 | SELECT Person.Id 2 | ,Person.Name + Person.SecondName Name 3 | ,Address.City 4 | FROM demo.Person Person 5 | LEFT JOIN demo.PersonAddress Address ON Person.Id = Address.PersonId -------------------------------------------------------------------------------- /Sources/IntegrationTests/MsSql/New/01.Tables/01.Person.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE demo.Person 2 | ( 3 | Id INT NOT NULL IDENTITY(1, 1) 4 | ,Name NVARCHAR(250) NOT NULL 5 | ) 6 | GO 7 | 8 | ALTER TABLE demo.Person ADD CONSTRAINT PK_demo_Person PRIMARY KEY CLUSTERED (Id) 9 | GO 10 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MsSql/New/01.Tables/02.PersonAddress.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE demo.PersonAddress 2 | ( 3 | Id INT NOT NULL IDENTITY(1, 1) 4 | ,PersonId INT NOT NULL 5 | ,City NVARCHAR(250) NOT NULL 6 | ) 7 | GO 8 | 9 | ALTER TABLE demo.PersonAddress ADD CONSTRAINT PK_demo_PersonAddress PRIMARY KEY CLUSTERED (Id) 10 | GO 11 | 12 | ALTER TABLE demo.PersonAddress ADD CONSTRAINT FK_PersonAddress_Person FOREIGN KEY (PersonId) REFERENCES demo.Person (Id) 13 | GO 14 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MsSql/New/01.create.sql: -------------------------------------------------------------------------------- 1 | USE master 2 | GO 3 | 4 | EXEC msdb.dbo.sp_delete_database_backuphistory @database_name = N'{{DbName}}' 5 | GO 6 | 7 | IF DB_ID('{{DbName}}') IS NOT NULL BEGIN 8 | ALTER DATABASE [{{DbName}}] SET SINGLE_USER WITH ROLLBACK IMMEDIATE 9 | END 10 | GO 11 | 12 | IF DB_ID('{{DbName}}') IS NOT NULL BEGIN 13 | PRINT 'drop {{DbName}}' 14 | DROP DATABASE [{{DbName}}] 15 | END 16 | GO 17 | 18 | CREATE DATABASE [{{DbName}}] 19 | GO 20 | 21 | ALTER DATABASE [{{DbName}}] SET RECOVERY SIMPLE 22 | GO 23 | 24 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MsSql/New/02.Data/01.Person.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO demo.Person(Name) 2 | VALUES ('John'), ('Maria') 3 | GO 4 | 5 | SELECT * FROM demo.Person -------------------------------------------------------------------------------- /Sources/IntegrationTests/MsSql/New/02.Data/02.PersonAddress.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO demo.PersonAddress(PersonId, City) 2 | SELECT Person.Id, '{{JohnCity}}' 3 | FROM demo.Person Person 4 | WHERE Person.Name = 'John' 5 | GO 6 | 7 | INSERT INTO demo.PersonAddress(PersonId, City) 8 | SELECT Person.Id, '{{MariaCity}}' 9 | FROM demo.Person Person 10 | WHERE Person.Name = 'Maria' 11 | GO 12 | 13 | SELECT * FROM demo.PersonAddress -------------------------------------------------------------------------------- /Sources/IntegrationTests/MsSql/New/02.schemas.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding(SupportsShouldProcess=$true)] 2 | param ( 3 | $Command, 4 | $Variables 5 | ) 6 | 7 | $Command.CommandText = "CREATE SCHEMA demo" 8 | $Command.ExecuteNonQuery() 9 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MsSql/New/03.version.sql: -------------------------------------------------------------------------------- 1 | EXEC sys.sp_addextendedproperty @name=N'version', @value=N'1.2' 2 | GO 3 | 4 | EXEC sys.sp_addextendedproperty @name=N'version-ModuleA', @value=N'1.0' 5 | GO 6 | 7 | EXEC sys.sp_addextendedproperty @name=N'version-ModuleB', @value=N'1.0' 8 | GO 9 | 10 | EXEC sys.sp_addextendedproperty @name=N'version-ModuleC', @value=N'1.0' 11 | GO -------------------------------------------------------------------------------- /Sources/IntegrationTests/MsSql/Upgrade/1.0_1.2.sql: -------------------------------------------------------------------------------- 1 | /* should neve be executed: current version is 1.2 */ 2 | 3 | DROP DATABASE [{{DbName}}] 4 | GO -------------------------------------------------------------------------------- /Sources/IntegrationTests/MsSql/Upgrade/1.2_2.0.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding(SupportsShouldProcess=$true)] 2 | param ( 3 | $Command, 4 | $Variables 5 | ) 6 | 7 | $Command.CommandText = "ALTER TABLE demo.Person ADD SecondName NVARCHAR(250) NULL" 8 | $Command.ExecuteNonQuery() 9 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MsSql/Upgrade/2.0_2.1.sql: -------------------------------------------------------------------------------- 1 | UPDATE demo.Person 2 | SET SecondName = '{{JohnSecondName}}' 3 | WHERE Name = 'John' 4 | GO 5 | 6 | UPDATE demo.Person 7 | SET SecondName = '{{MariaSecondName}}' 8 | WHERE Name = 'Maria' 9 | GO 10 | 11 | SELECT * FROM demo.Person -------------------------------------------------------------------------------- /Sources/IntegrationTests/MsSql/Upgrade/SqlDatabase.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
6 | 7 | 8 | 9 | 11 | 12 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MsSql/UpgradeModularity/SqlDatabase.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
6 | 7 | 8 | 9 | 11 | 12 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MsSql/UpgradeModularity/moduleA_1.0_2.0.sql: -------------------------------------------------------------------------------- 1 | CREATE SCHEMA moduleA 2 | GO 3 | 4 | CREATE TABLE moduleA.Person 5 | ( 6 | Id INT NOT NULL IDENTITY(1, 1) 7 | ,Name NVARCHAR(250) NOT NULL 8 | ) 9 | GO 10 | 11 | ALTER TABLE moduleA.Person ADD CONSTRAINT PK_moduleA_Person PRIMARY KEY CLUSTERED (Id) 12 | GO 13 | 14 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MsSql/UpgradeModularity/moduleB_1.0_1.1.sql: -------------------------------------------------------------------------------- 1 | -- module dependency: moduleA 2.0 2 | GO 3 | 4 | CREATE SCHEMA moduleB 5 | GO 6 | 7 | CREATE TABLE moduleB.PersonAddress 8 | ( 9 | Id INT NOT NULL IDENTITY(1, 1) 10 | ,PersonId INT NOT NULL 11 | ,City NVARCHAR(250) NOT NULL 12 | ) 13 | GO 14 | 15 | ALTER TABLE moduleB.PersonAddress ADD CONSTRAINT PK_moduleB_PersonAddress PRIMARY KEY CLUSTERED (Id) 16 | GO 17 | 18 | ALTER TABLE moduleB.PersonAddress ADD CONSTRAINT FK_PersonAddress_Person FOREIGN KEY (PersonId) REFERENCES moduleA.Person (Id) 19 | GO 20 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MsSql/UpgradeModularity/moduleC_1.0_2.0.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding(SupportsShouldProcess=$true)] 2 | param ( 3 | $Command, 4 | $Variables 5 | ) 6 | 7 | $Command.CommandText = "INSERT INTO moduleA.Person(Name) VALUES ('John'), ('Maria')" 8 | $Command.ExecuteNonQuery() 9 | 10 | $Command.CommandText = "INSERT INTO moduleB.PersonAddress(PersonId, City) SELECT Person.Id, 'London' FROM demo.Person Person WHERE Person.Name = 'John'" 11 | $Command.ExecuteNonQuery() 12 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MsSql/UpgradeModularity/moduleC_1.0_2.0.txt: -------------------------------------------------------------------------------- 1 | -- module dependency: moduleA 2.0 2 | -- module dependency: moduleB 1.1 3 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MySql/Execute/drop.database.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param ( 3 | $Command, 4 | $Variables 5 | ) 6 | 7 | Write-Information ("drop " + $Variables.DatabaseName) 8 | 9 | $Command.CommandText = ("DROP DATABASE {0}" -f $Variables.DatabaseName) 10 | $Command.ExecuteNonQuery() 11 | 12 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MySql/Export/export.sql: -------------------------------------------------------------------------------- 1 | SELECT person.id 2 | ,concat(person.name, ' ', person.second_name) AS name 3 | ,address.city 4 | FROM person person 5 | LEFT JOIN person_address address ON person.id = address.person_id -------------------------------------------------------------------------------- /Sources/IntegrationTests/MySql/New/01.Tables/01.person.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE person 2 | ( 3 | id INT NOT NULL AUTO_INCREMENT 4 | ,name VARCHAR(250) NOT NULL 5 | ,PRIMARY KEY pk_person (id) 6 | ); 7 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MySql/New/01.Tables/02.person_address.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE person_address 2 | ( 3 | id INT NOT NULL AUTO_INCREMENT 4 | ,person_id INT NOT NULL 5 | ,city VARCHAR(250) NOT NULL 6 | ,PRIMARY KEY pk_person_address (id) 7 | ); 8 | 9 | ALTER TABLE person_address ADD CONSTRAINT fk_person_address_person FOREIGN KEY (person_id) REFERENCES person (id); 10 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MySql/New/01.create.sql: -------------------------------------------------------------------------------- 1 | DROP DATABASE IF EXISTS {{DatabaseName}}; 2 | 3 | CREATE DATABASE {{DatabaseName}}; -------------------------------------------------------------------------------- /Sources/IntegrationTests/MySql/New/02.Data/01.person.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO person(name) 2 | VALUES ('John'), ('Maria'); 3 | 4 | SELECT * FROM person; -------------------------------------------------------------------------------- /Sources/IntegrationTests/MySql/New/02.Data/02.person_address.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO person_address(person_id, city) 2 | SELECT person.id, '{{JohnCity}}' 3 | FROM person person 4 | WHERE person.Name = 'John'; 5 | 6 | INSERT INTO person_address(person_id, city) 7 | SELECT person.id, '{{MariaCity}}' 8 | FROM person person 9 | WHERE person.name = 'Maria'; 10 | 11 | SELECT * FROM person_address; -------------------------------------------------------------------------------- /Sources/IntegrationTests/MySql/New/05.version.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE version 2 | ( 3 | module_name VARCHAR(20) NOT NULL 4 | ,version VARCHAR(20) NOT NULL 5 | ); 6 | 7 | ALTER TABLE version ADD CONSTRAINT pk_version PRIMARY KEY (module_name); 8 | 9 | INSERT INTO version (module_name, version) VALUES 10 | ('database', '1.2') 11 | ,('ModuleA', '1.0') 12 | ,('ModuleB', '1.0') 13 | ,('ModuleC', '1.0'); 14 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MySql/Upgrade/1.0_1.2.sql: -------------------------------------------------------------------------------- 1 | /* should neve be executed: current version is 1.2 */ 2 | 3 | DROP DATABASE {{DbName}}; -------------------------------------------------------------------------------- /Sources/IntegrationTests/MySql/Upgrade/1.2_2.0.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding(SupportsShouldProcess=$true)] 2 | param ( 3 | $Command, 4 | $Variables 5 | ) 6 | 7 | $Command.CommandText = "ALTER TABLE person ADD second_name varchar(250) NULL" 8 | $Command.ExecuteNonQuery() 9 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MySql/Upgrade/2.0_2.1.sql: -------------------------------------------------------------------------------- 1 | UPDATE person 2 | SET second_name = '{{JohnSecondName}}' 3 | WHERE name = 'John'; 4 | 5 | UPDATE person 6 | SET second_name = '{{MariaSecondName}}' 7 | WHERE name = 'Maria'; 8 | 9 | SELECT * FROM person; -------------------------------------------------------------------------------- /Sources/IntegrationTests/MySql/Upgrade/SqlDatabase.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
6 | 7 | 8 | 9 | 11 | 12 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MySql/UpgradeModularity/SqlDatabase.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
6 | 7 | 8 | 9 | 11 | 12 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MySql/UpgradeModularity/moduleA_1.0_2.0.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE module_a_person 2 | ( 3 | id INT NOT NULL AUTO_INCREMENT 4 | ,name VARCHAR(250) NOT NULL 5 | ,PRIMARY KEY pk_module_a_person (id) 6 | ); 7 | 8 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MySql/UpgradeModularity/moduleB_1.0_1.1.sql: -------------------------------------------------------------------------------- 1 | -- module dependency: moduleA 2.0 2 | 3 | CREATE TABLE module_b_person_address 4 | ( 5 | id INT NOT NULL AUTO_INCREMENT 6 | ,person_id INT NOT NULL 7 | ,city VARCHAR(250) NOT NULL 8 | ,PRIMARY KEY pk_module_b_person_address (id) 9 | ); 10 | 11 | ALTER TABLE module_b_person_address ADD CONSTRAINT fk_module_b_person_address_person FOREIGN KEY (person_id) REFERENCES module_a_person (id); 12 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MySql/UpgradeModularity/moduleC_1.0_2.0.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding(SupportsShouldProcess=$true)] 2 | param ( 3 | $Command, 4 | $Variables 5 | ) 6 | 7 | $Command.CommandText = "INSERT INTO module_a_person(name) VALUES ('John'), ('Maria')" 8 | $Command.ExecuteNonQuery() 9 | 10 | $Command.CommandText = "INSERT INTO module_b_person_address(person_id, city) SELECT person.id, 'London' FROM person person WHERE person.name = 'John'" 11 | $Command.ExecuteNonQuery() 12 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/MySql/UpgradeModularity/moduleC_1.0_2.0.txt: -------------------------------------------------------------------------------- 1 | -- module dependency: moduleA 2.0 2 | -- module dependency: moduleB 1.1 3 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/Execute/drop.database.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param ( 3 | $Command, 4 | $Variables 5 | ) 6 | 7 | $Command.Connection.ChangeDatabase("postgres"); 8 | 9 | Write-Information ("drop " + $Variables.DatabaseName) 10 | 11 | $Command.CommandText = ("DROP DATABASE {0} WITH (FORCE)" -f $Variables.DatabaseName) 12 | $Command.ExecuteNonQuery() 13 | 14 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/Export/export.sql: -------------------------------------------------------------------------------- 1 | SELECT person.id 2 | ,person.name || person.second_name AS name 3 | ,address.city 4 | FROM demo.person person 5 | LEFT JOIN demo.person_address address ON person.id = address.person_id -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/New/01.Tables/01.person.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE demo.person 2 | ( 3 | id serial 4 | ,name varchar(250) NOT NULL 5 | ); 6 | 7 | ALTER TABLE demo.person ADD CONSTRAINT pk_demo_person PRIMARY KEY (id); 8 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/New/01.Tables/02.person_address.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE demo.person_address 2 | ( 3 | id serial 4 | ,person_id integer NOT NULL 5 | ,city varchar(250) NOT NULL 6 | ); 7 | 8 | ALTER TABLE demo.person_address ADD CONSTRAINT pk_demo_person_address PRIMARY KEY (id); 9 | 10 | ALTER TABLE demo.person_address ADD CONSTRAINT fk_demo_person_address_person FOREIGN KEY (person_id) REFERENCES demo.person (id); 11 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/New/01.drop.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param ( 3 | $Command, 4 | $Variables 5 | ) 6 | 7 | $Command.Connection.ChangeDatabase("postgres"); 8 | 9 | $Command.CommandText = ("DROP DATABASE IF EXISTS {0} WITH (FORCE)" -f $Variables.DatabaseName) 10 | $Command.ExecuteNonQuery() -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/New/02.Data/01.person.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO demo.person(name) 2 | VALUES ('John'), ('Maria'); 3 | 4 | SELECT * FROM demo.person; -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/New/02.Data/02.person_address.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO demo.person_address(person_id, city) 2 | SELECT person.id, '{{JohnCity}}' 3 | FROM demo.person person 4 | WHERE person.Name = 'John'; 5 | 6 | INSERT INTO demo.person_address(person_id, city) 7 | SELECT person.id, '{{MariaCity}}' 8 | FROM demo.person person 9 | WHERE person.name = 'Maria'; 10 | 11 | SELECT * FROM demo.person_address; -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/New/02.create.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE {{DatabaseName}}; -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/New/03.database_properties.sql: -------------------------------------------------------------------------------- 1 | CREATE EXTENSION citext; -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/New/04.schemas.sql: -------------------------------------------------------------------------------- 1 | CREATE SCHEMA demo; -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/New/05.version.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE public.version 2 | ( 3 | module_name public.citext NOT NULL 4 | ,version varchar(20) NOT NULL 5 | ); 6 | 7 | ALTER TABLE public.version 8 | ADD CONSTRAINT pk_version PRIMARY KEY (module_name); 9 | 10 | INSERT INTO public.version (module_name, version) VALUES 11 | ('database', '1.2') 12 | ,('ModuleA', '1.0') 13 | ,('ModuleB', '1.0') 14 | ,('ModuleC', '1.0'); 15 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/Upgrade/1.0_1.2.sql: -------------------------------------------------------------------------------- 1 | /* should neve be executed: current version is 1.2 */ 2 | 3 | DROP DATABASE {{DbName}}; -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/Upgrade/1.2_2.0.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding(SupportsShouldProcess=$true)] 2 | param ( 3 | $Command, 4 | $Variables 5 | ) 6 | 7 | $Command.CommandText = "ALTER TABLE demo.person ADD second_name varchar(250) NULL" 8 | $Command.ExecuteNonQuery() 9 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/Upgrade/2.0_2.1.sql: -------------------------------------------------------------------------------- 1 | UPDATE demo.person 2 | SET second_name = '{{JohnSecondName}}' 3 | WHERE name = 'John'; 4 | 5 | UPDATE demo.person 6 | SET second_name = '{{MariaSecondName}}' 7 | WHERE name = 'Maria'; 8 | 9 | SELECT * FROM demo.person; -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/Upgrade/SqlDatabase.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
6 | 7 | 8 | 9 | 11 | 12 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/UpgradeModularity/SqlDatabase.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
6 | 7 | 8 | 9 | 11 | 12 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/UpgradeModularity/moduleA_1.0_2.0.sql: -------------------------------------------------------------------------------- 1 | CREATE SCHEMA module_a; 2 | 3 | CREATE TABLE module_a.person 4 | ( 5 | id serial 6 | ,name varchar(250) NOT NULL 7 | ); 8 | 9 | ALTER TABLE module_a.person ADD CONSTRAINT pk_module_a_person PRIMARY KEY (id); 10 | 11 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/UpgradeModularity/moduleB_1.0_1.1.sql: -------------------------------------------------------------------------------- 1 | -- module dependency: moduleA 2.0 2 | ; 3 | 4 | CREATE SCHEMA module_b; 5 | 6 | CREATE TABLE module_b.person_address 7 | ( 8 | id serial 9 | ,person_id integer NOT NULL 10 | ,city varchar(250) NOT NULL 11 | ); 12 | 13 | ALTER TABLE module_b.person_address ADD CONSTRAINT pk_module_b_person_address PRIMARY KEY (id); 14 | 15 | ALTER TABLE module_b.person_address ADD CONSTRAINT fk_module_b_person_address_person FOREIGN KEY (person_id) REFERENCES module_a.person (id); 16 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/UpgradeModularity/moduleC_1.0_2.0.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding(SupportsShouldProcess=$true)] 2 | param ( 3 | $Command, 4 | $Variables 5 | ) 6 | 7 | $Command.CommandText = "INSERT INTO module_a.person(name) VALUES ('John'), ('Maria')" 8 | $Command.ExecuteNonQuery() 9 | 10 | $Command.CommandText = "INSERT INTO module_b.person_address(person_id, city) SELECT person.id, 'London' FROM demo.person person WHERE person.name = 'John'" 11 | $Command.ExecuteNonQuery() 12 | -------------------------------------------------------------------------------- /Sources/IntegrationTests/PgSql/UpgradeModularity/moduleC_1.0_2.0.txt: -------------------------------------------------------------------------------- 1 | -- module dependency: moduleA 2.0 2 | -- module dependency: moduleB 1.1 3 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.AssemblyScripts.Test/NetCore/NetCoreSubDomainTest.StepWithSubDomain.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter.AssemblyScripts.NetCore; 2 | 3 | public partial class NetCoreSubDomainTest 4 | { 5 | public sealed class StepWithCoreSubDomain 6 | { 7 | public void ShowAppBase(IDbCommand command) 8 | { 9 | var assembly = GetType().Assembly; 10 | 11 | command.CommandText = assembly.Location; 12 | command.ExecuteNonQuery(); 13 | 14 | command.CommandText = AppDomain.CurrentDomain.BaseDirectory; 15 | command.ExecuteNonQuery(); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.AssemblyScripts/CodeAnalysis/AllowNullAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace System.Diagnostics.CodeAnalysis; 2 | 3 | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)] 4 | internal sealed class AllowNullAttribute : Attribute; 5 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.AssemblyScripts/CodeAnalysis/NotNullWhenAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace System.Diagnostics.CodeAnalysis; 2 | 3 | internal sealed class NotNullWhenAttribute : Attribute 4 | { 5 | public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue; 6 | 7 | public bool ReturnValue { get; } 8 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.AssemblyScripts/ExecuteMethodResolverBase.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | namespace SqlDatabase.Adapter.AssemblyScripts; 4 | 5 | internal abstract class ExecuteMethodResolverBase 6 | { 7 | public abstract bool IsMatch(MethodInfo method); 8 | 9 | public abstract Action> CreateDelegate(object instance, MethodInfo method); 10 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.AssemblyScripts/IEntryPoint.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter.AssemblyScripts; 2 | 3 | internal interface IEntryPoint 4 | { 5 | bool Execute(IDbCommand command, IReadOnlyDictionary variables); 6 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.AssemblyScripts/ISubDomain.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter.AssemblyScripts; 2 | 3 | internal interface ISubDomain : IDisposable 4 | { 5 | void Initialize(); 6 | 7 | void Unload(); 8 | 9 | bool ResolveScriptExecutor(string className, string methodName); 10 | 11 | bool Execute(IDbCommand command, IVariables variables); 12 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.AssemblyScripts/SqlDatabase.Adapter.AssemblyScripts.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.MsSql.Test/MsSqlDatabaseAdapterFactoryTest.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using Shouldly; 3 | 4 | namespace SqlDatabase.Adapter.MsSql; 5 | 6 | [TestFixture] 7 | public class MsSqlDatabaseAdapterFactoryTest 8 | { 9 | [Test] 10 | public void CanBe() 11 | { 12 | MsSqlDatabaseAdapterFactory.CanBe(MsSqlQuery.GetConnectionString()).ShouldBeTrue(); 13 | } 14 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.MsSql.Test/MsSqlQuery.cs: -------------------------------------------------------------------------------- 1 | using System.Data.SqlClient; 2 | using SqlDatabase.TestApi; 3 | 4 | namespace SqlDatabase.Adapter.MsSql; 5 | 6 | internal static class MsSqlQuery 7 | { 8 | public static string GetConnectionString() 9 | { 10 | return ConfigurationExtensions.GetConnectionString("mssql"); 11 | } 12 | 13 | public static SqlConnection Open() 14 | { 15 | var con = new SqlConnection(GetConnectionString()); 16 | con.Open(); 17 | 18 | return con; 19 | } 20 | 21 | public static object? ExecuteScalar(string sql) 22 | { 23 | using (var connection = Open()) 24 | using (var cmd = connection.CreateCommand()) 25 | { 26 | cmd.CommandText = sql; 27 | return cmd.ExecuteScalar(); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.MsSql.Test/MsSqlTextReaderTest.Go/Case01.sql: -------------------------------------------------------------------------------- 1 | PRINT 'F' 2 | GO 3 | 4 | -------------- 5 | PRINT 'F' -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.MsSql.Test/MsSqlTextReaderTest.Go/Case02.sql: -------------------------------------------------------------------------------- 1 | PRINT 1 2 | go 3 | 4 | GO 5 | 6 | GO 7 | 8 | PRINT 2 9 | GO 10 | PRINT 3 11 | 12 | PRINT 4 13 | 14 | go 15 | 16 | PRINT 5 17 | 18 | -------------- 19 | PRINT 1 20 | -------------- 21 | PRINT 2 22 | -------------- 23 | PRINT 3 24 | 25 | PRINT 4 26 | 27 | -------------- 28 | PRINT 5 -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.MsSql.Test/MsSqlTextReaderTest.Go/CaseOneLineComment.sql: -------------------------------------------------------------------------------- 1 | --PRINT A 2 | --GO 3 | PRINT 'B' 4 | GO 5 | 6 | -------------- 7 | --PRINT A 8 | --GO 9 | PRINT 'B' -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.MsSql.Test/MsSqlTextReaderTest.Go/CaseStoredProcedure.sql: -------------------------------------------------------------------------------- 1 | CREATE PROCEDURE A 2 | AS BEGIN 3 | END 4 | GO 5 | 6 | DROP PROCEDURE A 7 | GO 8 | 9 | -------------- 10 | CREATE PROCEDURE A 11 | AS BEGIN 12 | END 13 | -------------- 14 | DROP PROCEDURE A -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.MsSql.Test/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.MsSql/MsSqlDefaults.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter.MsSql; 2 | 3 | internal static class MsSqlDefaults 4 | { 5 | public const string DefaultSelectVersion = "SELECT value from sys.fn_listextendedproperty('version', default, default, default, default, default, default)"; 6 | public const string DefaultUpdateVersion = "EXEC sys.sp_updateextendedproperty @name=N'version', @value=N'{{TargetVersion}}'"; 7 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.MsSql/MsSqlValueDataReader.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter.MsSql; 2 | 3 | internal class MsSqlValueDataReader : IValueDataReader 4 | { 5 | public object? Read(IDataReader source, int ordinal) => source[ordinal]; 6 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.MsSql/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("SqlDatabase.Adapter.MsSql.Test, PublicKey=002400000480000094000000060200000024000052534131000400000100010055AB0DC1F8A24FB41E7358B65A606EC92141F1ABAFBFF062635AB5FAEB22308CFFBC8B54F3436694F14F6FD6C145D4F16C13A3E739FFCA837902BB78E2D51B890D964CC7384C2CC6B844AE37323F501F29E3EDC2DFADA82C99F5FBB5197ED757D795C2E5408DCB3FBAF9DDDF39E60B137ED0A23603A361EA811E6ADB605DFECC")] 4 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.MsSql/SqlDatabase.Adapter.MsSql.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | bin\ 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.MySql.Test/MySqlQuery.cs: -------------------------------------------------------------------------------- 1 | using MySqlConnector; 2 | using SqlDatabase.TestApi; 3 | 4 | namespace SqlDatabase.Adapter.MySql; 5 | 6 | internal static class MySqlQuery 7 | { 8 | public static string GetConnectionString() 9 | { 10 | return ConfigurationExtensions.GetConnectionString("mysql"); 11 | } 12 | 13 | public static MySqlConnection Open() 14 | { 15 | var con = new MySqlConnection(GetConnectionString()); 16 | con.Open(); 17 | 18 | return con; 19 | } 20 | 21 | public static object? ExecuteScalar(string sql) 22 | { 23 | using (var connection = Open()) 24 | using (var cmd = connection.CreateCommand()) 25 | { 26 | cmd.CommandText = sql; 27 | return cmd.ExecuteScalar(); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.MySql.Test/SqlDatabase.Adapter.MySql.Test.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net472;net6.0;net8.0;net9.0 5 | SqlDatabase.Adapter.MySql 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.MySql.Test/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.MySql/MySqlDefaults.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter.MySql; 2 | 3 | internal static class MySqlDefaults 4 | { 5 | public const string DefaultSelectVersion = "SELECT version FROM version WHERE module_name = 'database'"; 6 | public const string DefaultUpdateVersion = "UPDATE version SET version='{{TargetVersion}}' WHERE module_name = 'database'"; 7 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.MySql/MySqlValueDataReader.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter.MySql; 2 | 3 | internal sealed class MySqlValueDataReader : IValueDataReader 4 | { 5 | public object? Read(IDataReader source, int ordinal) => source[ordinal]; 6 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.MySql/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("SqlDatabase.Adapter.MySql.Test, PublicKey=002400000480000094000000060200000024000052534131000400000100010055AB0DC1F8A24FB41E7358B65A606EC92141F1ABAFBFF062635AB5FAEB22308CFFBC8B54F3436694F14F6FD6C145D4F16C13A3E739FFCA837902BB78E2D51B890D964CC7384C2CC6B844AE37323F501F29E3EDC2DFADA82C99F5FBB5197ED757D795C2E5408DCB3FBAF9DDDF39E60B137ED0A23603A361EA811E6ADB605DFECC")] 4 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.MySql/SqlDatabase.Adapter.MySql.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PgSql.Test/SqlDatabase.Adapter.PgSql.Test.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net472;net6.0;net8.0;net9.0 5 | SqlDatabase.Adapter.PgSql 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PgSql.Test/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PgSql/PgSqlDefaults.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter.PgSql; 2 | 3 | internal static class PgSqlDefaults 4 | { 5 | public const string DefaultSelectVersion = "SELECT version FROM public.version WHERE module_name = 'database'"; 6 | public const string DefaultUpdateVersion = "UPDATE public.version SET version='{{TargetVersion}}' WHERE module_name = 'database'"; 7 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PgSql/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("SqlDatabase.Adapter.PgSql.Test, PublicKey=002400000480000094000000060200000024000052534131000400000100010055AB0DC1F8A24FB41E7358B65A606EC92141F1ABAFBFF062635AB5FAEB22308CFFBC8B54F3436694F14F6FD6C145D4F16C13A3E739FFCA837902BB78E2D51B890D964CC7384C2CC6B844AE37323F501F29E3EDC2DFADA82C99F5FBB5197ED757D795C2E5408DCB3FBAF9DDDF39E60B137ED0A23603A361EA811E6ADB605DFECC")] 4 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PgSql/SqlDatabase.Adapter.PgSql.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PgSql/UnmappedTypes/Composite.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter.PgSql.UnmappedTypes; 2 | 3 | internal sealed class Composite 4 | { 5 | public Composite(string[] names) 6 | { 7 | Names = names; 8 | Rows = new(0); 9 | } 10 | 11 | public string[] Names { get; } 12 | 13 | public List Rows { get; } 14 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PowerShellScripts.Test/PowerShellTest.ExecuteWhatIfIgnore.ps1: -------------------------------------------------------------------------------- 1 | param ( 2 | $Command, 3 | $Variables 4 | ) 5 | 6 | throw "not supported" 7 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PowerShellScripts.Test/PowerShellTest.ExecuteWhatIfInvoke.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding(SupportsShouldProcess=$true)] 2 | param ( 3 | $Command, 4 | $Variables 5 | ) 6 | 7 | if ($WhatIfPreference) { 8 | Write-Host "WhatIf accepted" 9 | } else { 10 | throw "not supported" 11 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PowerShellScripts.Test/PowerShellTest.HandleOutput.ps1: -------------------------------------------------------------------------------- 1 | Write-Host "hello from Write-Host" 2 | 3 | Write-Information "hello from Write-Information" 4 | 5 | Write-Warning "hello from Write-Warning" 6 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PowerShellScripts.Test/PowerShellTest.HandleThrow.ps1: -------------------------------------------------------------------------------- 1 | throw "Ooops!" 2 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PowerShellScripts.Test/PowerShellTest.HandleWriteError.ps1: -------------------------------------------------------------------------------- 1 | Write-Error "hello from Write-Error" 2 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PowerShellScripts.Test/PowerShellTest.ParametersBinding.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding(SupportsShouldProcess=$true)] 2 | param ( 3 | $Command, 4 | $Variables 5 | ) 6 | 7 | if ($WhatIfPreference) { 8 | throw "not supported" 9 | } 10 | 11 | $Command.CommandText = ("database name is {0}" -f $Variables.DatabaseName) 12 | $Command.ExecuteNonQuery() 13 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PowerShellScripts.Test/PowerShellWindowsTest.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using Shouldly; 3 | 4 | namespace SqlDatabase.Adapter.PowerShellScripts; 5 | 6 | [TestFixture] 7 | public class PowerShellWindowsTest 8 | { 9 | [Test] 10 | public void GetParentProcessId() 11 | { 12 | var processId = Process.GetCurrentProcess().Id; 13 | 14 | PowerShellWindows.GetParentProcessId(processId).ShouldNotBeNull(); 15 | } 16 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PowerShellScripts.Test/SqlDatabase.Adapter.PowerShellScripts.Test.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net472;net6.0;net8.0;net9.0 5 | SqlDatabase.Adapter.PowerShellScripts 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PowerShellScripts/CodeAnalysis/AllowNullAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace System.Diagnostics.CodeAnalysis; 2 | 3 | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)] 4 | internal sealed class AllowNullAttribute : Attribute; -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PowerShellScripts/CodeAnalysis/NotNullWhenAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace System.Diagnostics.CodeAnalysis; 2 | 3 | internal sealed class NotNullWhenAttribute : Attribute 4 | { 5 | public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue; 6 | 7 | public bool ReturnValue { get; } 8 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PowerShellScripts/IPowerShell.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter.PowerShellScripts; 2 | 3 | internal interface IPowerShell 4 | { 5 | bool SupportsShouldProcess(string script); 6 | 7 | void Invoke(string script, ILogger logger, params KeyValuePair[] parameters); 8 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PowerShellScripts/IPowerShellFactory.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter.PowerShellScripts; 2 | 3 | internal interface IPowerShellFactory 4 | { 5 | void Initialize(ILogger logger); 6 | 7 | IPowerShell Create(); 8 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PowerShellScripts/SqlDatabase.Adapter.PowerShellScripts.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.PowerShellScripts/VariablesProxy.cs: -------------------------------------------------------------------------------- 1 | using System.Dynamic; 2 | 3 | namespace SqlDatabase.Adapter.PowerShellScripts; 4 | 5 | internal sealed class VariablesProxy : DynamicObject 6 | { 7 | private readonly IVariables _variables; 8 | 9 | public VariablesProxy(IVariables variables) 10 | { 11 | _variables = variables; 12 | } 13 | 14 | public override bool TryGetMember( 15 | GetMemberBinder binder, 16 | [NotNullWhen(true)] out object? result) 17 | { 18 | result = _variables.GetValue(binder.Name); 19 | return result != null; 20 | } 21 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.Sql.Test/SqlDatabase.Adapter.Sql.Test.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net472;net6.0;net8.0;net9.0 5 | SqlDatabase.Adapter.Sql 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.Sql/Export/IDataExporter.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter.Sql.Export; 2 | 3 | public interface IDataExporter 4 | { 5 | SqlWriterBase Output { get; set; } 6 | 7 | ILogger Log { get; set; } 8 | 9 | void Export(IDataReader source, IValueDataReader valueReader, string tableName); 10 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.Sql/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("SqlDatabase.Adapter.Sql.Test, PublicKey=002400000480000094000000060200000024000052534131000400000100010055AB0DC1F8A24FB41E7358B65A606EC92141F1ABAFBFF062635AB5FAEB22308CFFBC8B54F3436694F14F6FD6C145D4F16C13A3E739FFCA837902BB78E2D51B890D964CC7384C2CC6B844AE37323F501F29E3EDC2DFADA82C99F5FBB5197ED757D795C2E5408DCB3FBAF9DDDF39E60B137ED0A23603A361EA811E6ADB605DFECC")] 4 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.Sql/SqlDatabase.Adapter.Sql.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter.Sql/TextScriptFactory.cs: -------------------------------------------------------------------------------- 1 | using SqlDatabase.FileSystem; 2 | 3 | namespace SqlDatabase.Adapter.Sql; 4 | 5 | public class TextScriptFactory : IScriptFactory 6 | { 7 | private readonly ISqlTextReader _textReader; 8 | 9 | public TextScriptFactory(ISqlTextReader textReader) 10 | { 11 | _textReader = textReader; 12 | } 13 | 14 | public bool IsSupported(IFile file) 15 | { 16 | return ".sql".Equals(file.Extension, StringComparison.OrdinalIgnoreCase); 17 | } 18 | 19 | public IScript FromFile(IFile file) 20 | { 21 | return new TextScript(file.Name, file.OpenRead, _textReader); 22 | } 23 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter/DataReaderTools.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter; 2 | 3 | public static class DataReaderTools 4 | { 5 | public static object? CleanValue(object? value) 6 | { 7 | if (value == null || Convert.IsDBNull(value)) 8 | { 9 | return null; 10 | } 11 | 12 | return value; 13 | } 14 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter/ExportTable.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter; 2 | 3 | public sealed class ExportTable 4 | { 5 | public ExportTable(string name) 6 | { 7 | Name = name; 8 | Columns = new List(); 9 | } 10 | 11 | public string Name { get; } 12 | 13 | public List Columns { get; } 14 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter/ExportTableColumn.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter; 2 | 3 | public struct ExportTableColumn 4 | { 5 | public string Name { get; set; } 6 | 7 | public string SqlDataTypeName { get; set; } 8 | 9 | public int Size { get; set; } 10 | 11 | public int? NumericPrecision { get; set; } 12 | 13 | public int? NumericScale { get; set; } 14 | 15 | public bool AllowNull { get; set; } 16 | 17 | public override string ToString() 18 | { 19 | return $"{Name} {SqlDataTypeName}({Size})"; 20 | } 21 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter/HostedRuntime.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter; 2 | 3 | public enum FrameworkVersion 4 | { 5 | Net472, 6 | Net6, 7 | Net8, 8 | Net9 9 | } 10 | 11 | public readonly struct HostedRuntime 12 | { 13 | public HostedRuntime(bool isPowershell, bool isWindows, FrameworkVersion version) 14 | { 15 | IsPowershell = isPowershell; 16 | IsWindows = isWindows; 17 | Version = version; 18 | } 19 | 20 | public bool IsPowershell { get; } 21 | 22 | public bool IsWindows { get; } 23 | 24 | public FrameworkVersion Version { get; } 25 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter/IDatabaseAdapter.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter; 2 | 3 | public interface IDatabaseAdapter 4 | { 5 | string DatabaseName { get; } 6 | 7 | string GetUserFriendlyConnectionString(); 8 | 9 | ISqlTextReader CreateSqlTextReader(); 10 | 11 | SqlWriterBase CreateSqlWriter(TextWriter output); 12 | 13 | IValueDataReader CreateValueDataReader(); 14 | 15 | IDbConnection CreateConnection(bool switchToMaster); 16 | 17 | string GetServerVersionSelectScript(); 18 | 19 | string GetDatabaseExistsScript(string databaseName); 20 | 21 | string GetVersionSelectScript(); 22 | 23 | string GetVersionUpdateScript(); 24 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter/ILogger.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter; 2 | 3 | public interface ILogger 4 | { 5 | void Error(string message); 6 | 7 | void Info(string message); 8 | 9 | IDisposable Indent(); 10 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter/IScript.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter; 2 | 3 | public interface IScript 4 | { 5 | string DisplayName { get; set; } 6 | 7 | void Execute(IDbCommand? command, IVariables variables, ILogger logger); 8 | 9 | IEnumerable ExecuteReader(IDbCommand command, IVariables variables, ILogger logger); 10 | 11 | TextReader? GetDependencies(); 12 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter/IScriptEnvironment.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter; 2 | 3 | public interface IScriptEnvironment 4 | { 5 | bool IsSupported(IScript script); 6 | 7 | void Initialize(ILogger logger); 8 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter/IScriptFactory.cs: -------------------------------------------------------------------------------- 1 | using SqlDatabase.FileSystem; 2 | 3 | namespace SqlDatabase.Adapter; 4 | 5 | public interface IScriptFactory 6 | { 7 | bool IsSupported(IFile file); 8 | 9 | IScript FromFile(IFile file); 10 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter/ISqlTextReader.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter; 2 | 3 | public interface ISqlTextReader 4 | { 5 | string? ReadFirstBatch(Stream sql); 6 | 7 | IEnumerable ReadBatches(Stream sql); 8 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter/IValueDataReader.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter; 2 | 3 | public interface IValueDataReader 4 | { 5 | object? Read(IDataReader source, int ordinal); 6 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter/IVariables.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter; 2 | 3 | public interface IVariables 4 | { 5 | string? GetValue(string name); 6 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter/SqlDatabase.Adapter.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Adapter/TransactionMode.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Adapter; 2 | 3 | public enum TransactionMode 4 | { 5 | None, 6 | PerStep 7 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.CommandLine.Test/Internal/ArgTest.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using Shouldly; 3 | 4 | namespace SqlDatabase.CommandLine.Internal; 5 | 6 | [TestFixture] 7 | public class ArgTest 8 | { 9 | [Test] 10 | [TestCase("command", null, null)] 11 | [TestCase("-", null, null)] 12 | [TestCase("-=", null, null)] 13 | [TestCase("-arg", "arg", null)] 14 | [TestCase("-arg =", "arg", null)] 15 | [TestCase("-arg = ", "arg", null)] 16 | [TestCase("-arg= value", "arg", "value")] 17 | public void TryParse(string value, string? expectedKey, string? expectedValue) 18 | { 19 | Arg.TryParse(value, out var actual).ShouldBe(expectedKey != null); 20 | 21 | if (expectedKey != null) 22 | { 23 | actual.Key.ShouldBe(expectedKey); 24 | actual.Value.ShouldBe(expectedValue); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.CommandLine.Test/SqlDatabase.CommandLine.Test.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net472;net6.0;net8.0;net9.0 5 | SqlDatabase.CommandLine 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.CommandLine/CodeAnalysis/AllowNullAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace System.Diagnostics.CodeAnalysis; 2 | 3 | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)] 4 | internal sealed class AllowNullAttribute : Attribute; -------------------------------------------------------------------------------- /Sources/SqlDatabase.CommandLine/CodeAnalysis/NotNullWhenAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace System.Diagnostics.CodeAnalysis; 2 | 3 | internal sealed class NotNullWhenAttribute : Attribute 4 | { 5 | public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue; 6 | 7 | public bool ReturnValue { get; } 8 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.CommandLine/CreateCommandLine.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.CommandLine; 2 | 3 | public sealed class CreateCommandLine : ICommandLine 4 | { 5 | public string Database { get; set; } = string.Empty; 6 | 7 | public List From { get; } = new(); 8 | 9 | public Dictionary Variables { get; } = new(StringComparer.OrdinalIgnoreCase); 10 | 11 | public string? Configuration { get; set; } 12 | 13 | public string? Log { get; set; } 14 | 15 | public string? UsePowerShell { get; set; } 16 | 17 | public bool WhatIf { get; set; } 18 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.CommandLine/ExecuteCommandLine.cs: -------------------------------------------------------------------------------- 1 | using SqlDatabase.Adapter; 2 | 3 | namespace SqlDatabase.CommandLine; 4 | 5 | public sealed class ExecuteCommandLine : ICommandLine 6 | { 7 | public string Database { get; set; } = string.Empty; 8 | 9 | public List From { get; } = new(); 10 | 11 | public TransactionMode Transaction { get; set; } 12 | 13 | public Dictionary Variables { get; } = new(StringComparer.OrdinalIgnoreCase); 14 | 15 | public string? Configuration { get; set; } 16 | 17 | public string? Log { get; set; } 18 | 19 | public string? UsePowerShell { get; set; } 20 | 21 | public bool WhatIf { get; set; } 22 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.CommandLine/ExportCommandLine.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.CommandLine; 2 | 3 | public sealed class ExportCommandLine : ICommandLine 4 | { 5 | public string Database { get; set; } = string.Empty; 6 | 7 | public List From { get; } = new(); 8 | 9 | public string? DestinationTableName { get; set; } 10 | 11 | public string? DestinationFileName { get; set; } 12 | 13 | public Dictionary Variables { get; } = new(StringComparer.OrdinalIgnoreCase); 14 | 15 | public string? Configuration { get; set; } 16 | 17 | public string? Log { get; set; } 18 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.CommandLine/ICommandLine.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.CommandLine; 2 | 3 | public interface ICommandLine 4 | { 5 | string? Log { get; } 6 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.CommandLine/Internal/IArgBinder.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.CommandLine.Internal; 2 | 3 | internal interface IArgBinder 4 | { 5 | bool Match(Arg arg); 6 | 7 | bool IsDuplicated(TCommand command, Arg arg); 8 | 9 | bool TryBind(TCommand command, Arg arg); 10 | 11 | bool IsAssigned(TCommand command, [NotNullWhen(false)] out string? key); 12 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.CommandLine/InvalidCommandLineException.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.CommandLine; 2 | 3 | public sealed class InvalidCommandLineException : SystemException 4 | { 5 | public InvalidCommandLineException() 6 | { 7 | } 8 | 9 | public InvalidCommandLineException(string message) 10 | : base(message) 11 | { 12 | } 13 | 14 | public InvalidCommandLineException(string message, Exception inner) 15 | : base(message, inner) 16 | { 17 | } 18 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.CommandLine/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("SqlDatabase.CommandLine.Test, PublicKey=002400000480000094000000060200000024000052534131000400000100010055AB0DC1F8A24FB41E7358B65A606EC92141F1ABAFBFF062635AB5FAEB22308CFFBC8B54F3436694F14F6FD6C145D4F16C13A3E739FFCA837902BB78E2D51B890D964CC7384C2CC6B844AE37323F501F29E3EDC2DFADA82C99F5FBB5197ED757D795C2E5408DCB3FBAF9DDDF39E60B137ED0A23603A361EA811E6ADB605DFECC")] -------------------------------------------------------------------------------- /Sources/SqlDatabase.CommandLine/ScriptSource.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.CommandLine; 2 | 3 | public readonly struct ScriptSource : IEquatable 4 | { 5 | public ScriptSource(bool isInline, string value) 6 | { 7 | IsInline = isInline; 8 | Value = value; 9 | } 10 | 11 | public bool IsInline { get; } 12 | 13 | public string Value { get; } 14 | 15 | public bool Equals(ScriptSource other) => 16 | IsInline == other.IsInline && string.Equals(Value, other.Value, StringComparison.Ordinal); 17 | 18 | public override bool Equals(object? obj) => obj is ScriptSource other && Equals(other); 19 | 20 | public override int GetHashCode() => StringComparer.Ordinal.GetHashCode(Value); 21 | 22 | public override string ToString() => Value; 23 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.CommandLine/SqlDatabase.CommandLine.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.CommandLine/UpgradeCommandLine.cs: -------------------------------------------------------------------------------- 1 | using SqlDatabase.Adapter; 2 | 3 | namespace SqlDatabase.CommandLine; 4 | 5 | public sealed class UpgradeCommandLine : ICommandLine 6 | { 7 | public string Database { get; set; } = string.Empty; 8 | 9 | public List From { get; } = new(); 10 | 11 | public TransactionMode Transaction { get; set; } 12 | 13 | public Dictionary Variables { get; } = new(StringComparer.OrdinalIgnoreCase); 14 | 15 | public string? Configuration { get; set; } 16 | 17 | public string? Log { get; set; } 18 | 19 | public string? UsePowerShell { get; set; } 20 | 21 | public bool WhatIf { get; set; } 22 | 23 | public bool FolderAsModuleName { get; set; } 24 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Configuration.Test/AppConfiguration.default.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Configuration.Test/AppConfiguration.empty.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Configuration.Test/SqlDatabase.dll.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Configuration/AssemblyScriptConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Configuration; 2 | 3 | public sealed class AssemblyScriptConfiguration 4 | { 5 | internal const string PropertyClassName = "className"; 6 | internal const string PropertyMethodName = "methodName"; 7 | 8 | public string? ClassName { get; set; } 9 | 10 | public string? MethodName { get; set; } 11 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Configuration/ConfigurationErrorsException.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Configuration; 2 | 3 | public sealed class ConfigurationErrorsException : ApplicationException 4 | { 5 | public ConfigurationErrorsException() 6 | { 7 | } 8 | 9 | public ConfigurationErrorsException(string message) 10 | : base(message) 11 | { 12 | } 13 | 14 | public ConfigurationErrorsException(string message, Exception inner) 15 | : base(message, inner) 16 | { 17 | } 18 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Configuration/DatabaseConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Configuration; 2 | 3 | public sealed class DatabaseConfiguration 4 | { 5 | internal const string PropertyGetCurrentVersionScript = "getCurrentVersion"; 6 | internal const string PropertySetCurrentVersionScript = "setCurrentVersion"; 7 | internal const string PropertyVariables = "variables"; 8 | 9 | public string? GetCurrentVersionScript { get; set; } 10 | 11 | public string? SetCurrentVersionScript { get; set; } 12 | 13 | public Dictionary Variables { get; } = new(StringComparer.OrdinalIgnoreCase); 14 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Configuration/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("SqlDatabase.Configuration.Test, PublicKey=002400000480000094000000060200000024000052534131000400000100010055AB0DC1F8A24FB41E7358B65A606EC92141F1ABAFBFF062635AB5FAEB22308CFFBC8B54F3436694F14F6FD6C145D4F16C13A3E739FFCA837902BB78E2D51B890D964CC7384C2CC6B844AE37323F501F29E3EDC2DFADA82C99F5FBB5197ED757D795C2E5408DCB3FBAF9DDDF39E60B137ED0A23603A361EA811E6ADB605DFECC")] 4 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] -------------------------------------------------------------------------------- /Sources/SqlDatabase.Configuration/SqlDatabase.Configuration.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.FileSystem.Test/Content.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Sources/SqlDatabase.FileSystem.Test/Content.zip -------------------------------------------------------------------------------- /Sources/SqlDatabase.FileSystem.Test/InLineScriptFileTest.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using Shouldly; 3 | 4 | namespace SqlDatabase.FileSystem; 5 | 6 | [TestFixture] 7 | public class InLineScriptFileTest 8 | { 9 | [Test] 10 | public void OpenRead() 11 | { 12 | const string Content = "some text"; 13 | 14 | var stream = new InLineScriptFile("name", Content).OpenRead(); 15 | using (stream) 16 | { 17 | stream.ShouldNotBeNull(); 18 | 19 | new StreamReader(stream).ReadToEnd().ShouldBe(Content); 20 | } 21 | } 22 | 23 | [Test] 24 | public void GetParent() 25 | { 26 | new InLineScriptFile("name", string.Empty).GetParent().ShouldBeNull(); 27 | } 28 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.FileSystem.Test/SqlDatabase.FileSystem.Test.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net472;net6.0;net8.0;net9.0 5 | SqlDatabase.FileSystem 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.FileSystem/CodeAnalysis/AllowNullAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace System.Diagnostics.CodeAnalysis; 2 | 3 | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)] 4 | internal sealed class AllowNullAttribute : Attribute; 5 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.FileSystem/CodeAnalysis/NotNullWhenAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace System.Diagnostics.CodeAnalysis; 2 | 3 | internal sealed class NotNullWhenAttribute : Attribute 4 | { 5 | public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue; 6 | 7 | public bool ReturnValue { get; } 8 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.FileSystem/FileSystemFile.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.FileSystem; 2 | 3 | internal sealed class FileSystemFile : IFile 4 | { 5 | public FileSystemFile(string location) 6 | { 7 | Location = location; 8 | Name = Path.GetFileName(location); 9 | Extension = Path.GetExtension(Name); 10 | } 11 | 12 | public string Name { get; } 13 | 14 | public string Location { get; } 15 | 16 | public string Extension { get; } 17 | 18 | public string GetFullName() => Location; 19 | 20 | public IFolder GetParent() => new FileSystemFolder(Path.GetDirectoryName(Location)!); 21 | 22 | public Stream OpenRead() => File.OpenRead(Location); 23 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.FileSystem/IFile.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.FileSystem; 2 | 3 | public interface IFile : IFileSystemInfo 4 | { 5 | string Extension { get; } 6 | 7 | IFolder? GetParent(); 8 | 9 | Stream OpenRead(); 10 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.FileSystem/IFileSystemFactory.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.FileSystem; 2 | 3 | public interface IFileSystemFactory 4 | { 5 | IFileSystemInfo FileSystemInfoFromPath(string? path); 6 | 7 | IFileSystemInfo FromContent(string name, string content); 8 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.FileSystem/IFileSystemInfo.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.FileSystem; 2 | 3 | public interface IFileSystemInfo 4 | { 5 | string Name { get; } 6 | 7 | string GetFullName(); 8 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.FileSystem/IFolder.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.FileSystem; 2 | 3 | public interface IFolder : IFileSystemInfo 4 | { 5 | IEnumerable GetFolders(); 6 | 7 | IEnumerable GetFiles(); 8 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.FileSystem/InLineScriptFile.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.FileSystem; 2 | 3 | internal sealed class InLineScriptFile : IFile 4 | { 5 | public InLineScriptFile(string name, string content) 6 | { 7 | Name = name; 8 | Content = content; 9 | Extension = Path.GetExtension(name); 10 | } 11 | 12 | public string Name { get; } 13 | 14 | public string Content { get; } 15 | 16 | public string Extension { get; } 17 | 18 | public string GetFullName() => Name; 19 | 20 | public IFolder? GetParent() => null; 21 | 22 | public Stream OpenRead() => new MemoryStream(Encoding.UTF8.GetBytes(Content)); 23 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.FileSystem/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("SqlDatabase.FileSystem.Test, PublicKey=002400000480000094000000060200000024000052534131000400000100010055AB0DC1F8A24FB41E7358B65A606EC92141F1ABAFBFF062635AB5FAEB22308CFFBC8B54F3436694F14F6FD6C145D4F16C13A3E739FFCA837902BB78E2D51B890D964CC7384C2CC6B844AE37323F501F29E3EDC2DFADA82C99F5FBB5197ED757D795C2E5408DCB3FBAF9DDDF39E60B137ED0A23603A361EA811E6ADB605DFECC")] 4 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] -------------------------------------------------------------------------------- /Sources/SqlDatabase.FileSystem/SqlDatabase.FileSystem.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.FileSystem/ZipEntryFolder.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.FileSystem; 2 | 3 | [DebuggerDisplay("{Name}")] 4 | internal sealed class ZipEntryFolder : IFolder 5 | { 6 | private readonly string _fullName; 7 | 8 | public ZipEntryFolder(string name, string fullName) 9 | { 10 | _fullName = fullName; 11 | Name = name; 12 | 13 | FolderByName = new Dictionary(StringComparer.OrdinalIgnoreCase); 14 | Files = new List(); 15 | } 16 | 17 | public string Name { get; } 18 | 19 | public IDictionary FolderByName { get; } 20 | 21 | public IList Files { get; } 22 | 23 | public string GetFullName() => _fullName; 24 | 25 | public IEnumerable GetFolders() => FolderByName.Values; 26 | 27 | public IEnumerable GetFiles() => Files; 28 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Package/SqlDatabase.Package.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net472 5 | 6 | 7 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Package/choco/tools/.skipAutoUninstaller: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Sources/SqlDatabase.Package/choco/tools/.skipAutoUninstaller -------------------------------------------------------------------------------- /Sources/SqlDatabase.Package/choco/tools/VERIFICATION.txt: -------------------------------------------------------------------------------- 1 | VERIFICATION 2 | Verification is intended to assist the Chocolatey moderators and community in verifying that this package's contents are trustworthy. 3 | 4 | To verify verify checksum contents: 5 | 6 | from sources: 7 | - build the sources from https://github.com/max-ieremenko/SqlDatabase to create the binary files to verify; 8 | - use Get-FileHash -Path to get the file hash value from both the built file and the file from the package and compare them; 9 | 10 | from PowerShell Gallery: 11 | - Save-Module -Name SqlDatabase -Path 12 | - use Get-FileHash -Path to get the file hash value from both the file from PowerShell Gallery and the file from the package and compare them; 13 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Package/choco/tools/chocolateybeforemodify.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = "Stop" 2 | 3 | if (Get-Module "SqlDatabase") { 4 | Remove-Module "SqlDatabase" -Force 5 | } 6 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Package/choco/tools/chocolateyinstall.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = "Stop" 2 | $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" 3 | 4 | if (Get-Module "SqlDatabase") { 5 | Remove-Module "SqlDatabase" -Force 6 | } 7 | 8 | $psd1File = Join-Path $toolsDir "SqlDatabase\SqlDatabase.psd1" 9 | $psd1 = Test-ModuleManifest -Path $psd1File -WarningAction Ignore -ErrorAction Stop 10 | 11 | $destination = Join-Path $env:ProgramFiles ("WindowsPowerShell\Modules\SqlDatabase\" + $psd1.Version.ToString()) 12 | if (Test-Path $destination) { 13 | Remove-Item -Path $destination -Force -Recurse 14 | } 15 | 16 | $source = Join-Path $toolsDir "SqlDatabase\*" 17 | New-Item -Path $destination -ItemType Directory | Out-Null 18 | Copy-Item -Path $source -Destination $destination 19 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Package/choco/tools/chocolateyuninstall.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = "Stop" 2 | 3 | if (Get-Module "SqlDatabase") { 4 | Remove-Module "SqlDatabase" -Force 5 | } 6 | 7 | $source = Join-Path -Path $env:ProgramFiles -ChildPath "WindowsPowerShell\Modules\SqlDatabase" 8 | Remove-Item -Path $source -Recurse -Force 9 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Package/nuget/tools/init.ps1: -------------------------------------------------------------------------------- 1 | param($installPath, $toolsPath, $package, $project) 2 | 3 | $obsoleteModule = Get-Module "SqlDatabase.PowerShell" 4 | if ($obsoleteModule) 5 | { 6 | Remove-Module "SqlDatabase.PowerShell" 7 | } 8 | 9 | $activeModule = Get-Module "SqlDatabase" 10 | $thisModule = Join-Path $PSScriptRoot "SqlDatabase.psd1" 11 | 12 | $import = $true 13 | if ($activeModule) 14 | { 15 | $thisModuleFile = Join-Path $PSScriptRoot "SqlDatabase.PowerShell.dll" 16 | $thisModuleVersion = New-Object -TypeName System.Version (Get-Item $thisModuleFile).VersionInfo.FileVersion 17 | if ($activeModule.Version -le $thisModuleVersion) 18 | { 19 | Remove-Module "SqlDatabase" 20 | } 21 | else 22 | { 23 | $import = $false 24 | } 25 | } 26 | 27 | if ($import) 28 | { 29 | Import-Module $thisModule 30 | } 31 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.PowerShell.Internal/CmdLetLogger.cs: -------------------------------------------------------------------------------- 1 | using SqlDatabase.Log; 2 | 3 | namespace SqlDatabase.PowerShell.Internal; 4 | 5 | internal sealed class CmdLetLogger : LoggerBase 6 | { 7 | private readonly Action _writeInfo; 8 | private readonly Action _writeError; 9 | 10 | public CmdLetLogger(Action writeInfo, Action writeError) 11 | { 12 | _writeInfo = writeInfo; 13 | _writeError = writeError; 14 | } 15 | 16 | protected override void WriteError(string message) => _writeError(message); 17 | 18 | protected override void WriteInfo(string message) => _writeInfo(message); 19 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.PowerShell.Internal/ISqlDatabaseProgram.cs: -------------------------------------------------------------------------------- 1 | using SqlDatabase.CommandLine; 2 | 3 | namespace SqlDatabase.PowerShell.Internal; 4 | 5 | internal interface ISqlDatabaseProgram 6 | { 7 | void ExecuteCommand(ICommandLine command); 8 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.PowerShell.Internal/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("SqlDatabase.PowerShell.Test, PublicKey=002400000480000094000000060200000024000052534131000400000100010055AB0DC1F8A24FB41E7358B65A606EC92141F1ABAFBFF062635AB5FAEB22308CFFBC8B54F3436694F14F6FD6C145D4F16C13A3E739FFCA837902BB78E2D51B890D964CC7384C2CC6B844AE37323F501F29E3EDC2DFADA82C99F5FBB5197ED757D795C2E5408DCB3FBAF9DDDF39E60B137ED0A23603A361EA811E6ADB605DFECC")] 4 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] -------------------------------------------------------------------------------- /Sources/SqlDatabase.PowerShell.Internal/SqlDatabase.PowerShell.Internal.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | ..\..\bin\SqlDatabase.PowerShell 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.PowerShell.Internal/SqlDatabaseProgram.cs: -------------------------------------------------------------------------------- 1 | using SqlDatabase.Adapter; 2 | using SqlDatabase.CommandLine; 3 | 4 | namespace SqlDatabase.PowerShell.Internal; 5 | 6 | internal sealed class SqlDatabaseProgram : ISqlDatabaseProgram 7 | { 8 | private readonly ILogger _logger; 9 | private readonly string _currentDirectory; 10 | 11 | public SqlDatabaseProgram(ILogger logger, string currentDirectory) 12 | { 13 | _logger = logger; 14 | _currentDirectory = currentDirectory; 15 | } 16 | 17 | public void ExecuteCommand(ICommandLine command) => Program.RunPowershell(_logger, command, _currentDirectory); 18 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.PowerShell.Test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Sources/SqlDatabase.PowerShell.Test/SqlDatabase.PowerShell.Test.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net472 5 | SqlDatabase.PowerShell 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.PowerShell/Internal/CmdLetLogger.cs: -------------------------------------------------------------------------------- 1 | using System.Management.Automation; 2 | 3 | namespace SqlDatabase.PowerShell.Internal; 4 | 5 | internal sealed class CmdLetLogger 6 | { 7 | private readonly Cmdlet _cmdlet; 8 | 9 | public CmdLetLogger(Cmdlet cmdlet) 10 | { 11 | _cmdlet = cmdlet; 12 | Info = WriteInfo; 13 | Error = WriteError; 14 | } 15 | 16 | public Action Info { get; } 17 | 18 | public Action Error { get; } 19 | 20 | private void WriteError(string message) => _cmdlet.WriteError(new ErrorRecord( 21 | new InvalidOperationException(message), 22 | null, 23 | ErrorCategory.NotSpecified, 24 | null)); 25 | 26 | private void WriteInfo(string message) => _cmdlet.WriteInformation(new InformationRecord(message, null)); 27 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.PowerShell/Internal/IDependencyResolver.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | namespace SqlDatabase.PowerShell.Internal; 4 | 5 | internal interface IDependencyResolver 6 | { 7 | void Attach(); 8 | 9 | void Detach(); 10 | 11 | Assembly? LoadDependency(string assemblyName); 12 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.PowerShell/Internal/PowerShellCoreDependencyResolver.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | namespace SqlDatabase.PowerShell.Internal; 4 | 5 | internal sealed class PowerShellCoreDependencyResolver : IDependencyResolver 6 | { 7 | private readonly PowerShellCoreAssemblyContext _context = new(); 8 | 9 | public void Attach() 10 | { 11 | } 12 | 13 | public void Detach() 14 | { 15 | } 16 | 17 | public Assembly? LoadDependency(string assemblyName) => _context.LoadDependency(assemblyName); 18 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.PowerShell/PSTransactionMode.cs: -------------------------------------------------------------------------------- 1 | using SqlDatabase.Adapter; 2 | 3 | namespace SqlDatabase.PowerShell; 4 | 5 | // do not load SqlDatabase.dll on Import-Module 6 | public enum PSTransactionMode 7 | { 8 | None = TransactionMode.None, 9 | 10 | PerStep = TransactionMode.PerStep 11 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.PowerShell/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("SqlDatabase.PowerShell.Test, PublicKey=002400000480000094000000060200000024000052534131000400000100010055AB0DC1F8A24FB41E7358B65A606EC92141F1ABAFBFF062635AB5FAEB22308CFFBC8B54F3436694F14F6FD6C145D4F16C13A3E739FFCA837902BB78E2D51B890D964CC7384C2CC6B844AE37323F501F29E3EDC2DFADA82C99F5FBB5197ED757D795C2E5408DCB3FBAF9DDDF39E60B137ED0A23603A361EA811E6ADB605DFECC")] 4 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] -------------------------------------------------------------------------------- /Sources/SqlDatabase.PowerShell/SqlDatabase.psd1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Sources/SqlDatabase.PowerShell/SqlDatabase.psd1 -------------------------------------------------------------------------------- /Sources/SqlDatabase.PowerShell/SqlDatabase.psm1: -------------------------------------------------------------------------------- 1 | Set-StrictMode -Version Latest 2 | 3 | if (($PSVersionTable.Keys -contains 'PSEdition') -and ($PSVersionTable.PSEdition -ne 'Desktop') -and ([version]$PSVersionTable.PSVersion -lt '7.2.0')) { 4 | Write-Error 'This module requires PowerShell 7.2+. Please, upgrade your PowerShell version.' 5 | Exit 1 6 | } 7 | 8 | $psModule = $ExecutionContext.SessionState.Module 9 | $root = $psModule.ModuleBase 10 | $dllPath = Join-Path -Path $root 'SqlDatabase.PowerShell.dll' 11 | 12 | $importedModule = Import-Module -Name $dllPath -PassThru 13 | 14 | # When the module is unloaded, remove the nested binary module that was loaded with it 15 | $psModule.OnRemove = { 16 | Remove-Module -ModuleInfo $importedModule 17 | } 18 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Sequence.Test/DependencyParserTest/Case01.sql: -------------------------------------------------------------------------------- 1 | /* 2 | * module dependency: a 2.0 3 | * module dependency: b 1.0 4 | */ 5 | 6 | -------------- 7 | a 2.0 8 | -------------- 9 | b 1.0 -------------------------------------------------------------------------------- /Sources/SqlDatabase.Sequence.Test/DependencyParserTest/Case02.sql: -------------------------------------------------------------------------------- 1 | -- module dependency: a 2.0 2 | -- module dependency: b 1.0 3 | 4 | -------------- 5 | a 2.0 6 | -------------- 7 | b 1.0 -------------------------------------------------------------------------------- /Sources/SqlDatabase.Sequence.Test/DependencyParserTest/Case03.sql: -------------------------------------------------------------------------------- 1 | /* 2 | -- some text module dependency: a 2.0 some text 3 | * some text module dependency: b 1.0 some text 4 | */ 5 | 6 | -------------- 7 | a 2.0 8 | -------------- 9 | b 1.0 -------------------------------------------------------------------------------- /Sources/SqlDatabase.Sequence.Test/DependencyParserTest/Case04.sql: -------------------------------------------------------------------------------- 1 | /* 2 | * module dependency: a_c 2.0 3 | * module dependency: b-c 1.0 4 | */ 5 | 6 | -------------- 7 | a_c 2.0 8 | -------------- 9 | b-c 1.0 -------------------------------------------------------------------------------- /Sources/SqlDatabase.Sequence.Test/DependencyParserTest/Case05.sql: -------------------------------------------------------------------------------- 1 | /* 2 | * module dependency: a_c - 2.0 3 | * module dependency: b-c - 1.0 4 | * module dependency: d - 3.0 some text 5 | */ 6 | -- module dependency: f-4.0 7 | -- module dependency: g-1-5.0 8 | 9 | -------------- 10 | a_c 2.0 11 | -------------- 12 | b-c 1.0 13 | -------------- 14 | d 3.0 15 | -------------- 16 | f 4.0 17 | -------------- 18 | g-1 5.0 -------------------------------------------------------------------------------- /Sources/SqlDatabase.Sequence.Test/DependencyParserTest/Empty.sql: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------- 4 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Sequence/CodeAnalysis/AllowNullAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace System.Diagnostics.CodeAnalysis; 2 | 3 | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)] 4 | internal sealed class AllowNullAttribute : Attribute; 5 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Sequence/CodeAnalysis/NotNullWhenAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace System.Diagnostics.CodeAnalysis; 2 | 3 | internal sealed class NotNullWhenAttribute : Attribute 4 | { 5 | public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue; 6 | 7 | public bool ReturnValue { get; } 8 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Sequence/GetDatabaseCurrentVersion.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Sequence; 2 | 3 | public delegate Version GetDatabaseCurrentVersion(string? moduleName); -------------------------------------------------------------------------------- /Sources/SqlDatabase.Sequence/ICreateScriptSequence.cs: -------------------------------------------------------------------------------- 1 | using SqlDatabase.Adapter; 2 | 3 | namespace SqlDatabase.Sequence; 4 | 5 | public interface ICreateScriptSequence 6 | { 7 | IList BuildSequence(); 8 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Sequence/IModuleVersionResolver.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Sequence; 2 | 3 | internal interface IModuleVersionResolver 4 | { 5 | // => InvalidOperationException fail to determine dependent module [{1}] version 6 | Version GetCurrentVersion(string? moduleName); 7 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Sequence/IUpgradeScriptSequence.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Sequence; 2 | 3 | public interface IUpgradeScriptSequence 4 | { 5 | IList BuildSequence(); 6 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Sequence/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("SqlDatabase.Sequence.Test, PublicKey=002400000480000094000000060200000024000052534131000400000100010055AB0DC1F8A24FB41E7358B65A606EC92141F1ABAFBFF062635AB5FAEB22308CFFBC8B54F3436694F14F6FD6C145D4F16C13A3E739FFCA837902BB78E2D51B890D964CC7384C2CC6B844AE37323F501F29E3EDC2DFADA82C99F5FBB5197ED757D795C2E5408DCB3FBAF9DDDF39E60B137ED0A23603A361EA811E6ADB605DFECC")] 4 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] -------------------------------------------------------------------------------- /Sources/SqlDatabase.Sequence/ScriptStep.cs: -------------------------------------------------------------------------------- 1 | using SqlDatabase.Adapter; 2 | 3 | namespace SqlDatabase.Sequence; 4 | 5 | [DebuggerDisplay("{Script.DisplayName}")] 6 | public readonly struct ScriptStep 7 | { 8 | public ScriptStep(string moduleName, Version from, Version to, IScript script) 9 | { 10 | ModuleName = moduleName; 11 | From = from; 12 | To = to; 13 | Script = script; 14 | } 15 | 16 | public string ModuleName { get; } 17 | 18 | public Version From { get; } 19 | 20 | public Version To { get; } 21 | 22 | public IScript Script { get; } 23 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.Sequence/SqlDatabase.Sequence.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.Test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Sources/SqlDatabase.Test/SqlDatabase.Test.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net472;net6.0;net8.0;net9.0 5 | SqlDatabase 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.TestApi/ConfigurationExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Xml; 2 | using Shouldly; 3 | 4 | namespace SqlDatabase.TestApi; 5 | 6 | public static class ConfigurationExtensions 7 | { 8 | public static string GetConnectionString(string name, Type? anchor = null) 9 | { 10 | if (anchor == null) 11 | { 12 | anchor = new StackTrace().GetFrame(1)!.GetMethod()!.DeclaringType; 13 | } 14 | 15 | var fileName = Path.Combine(AppContext.BaseDirectory, anchor.Assembly.GetName().Name + ".dll.config"); 16 | 17 | var config = new XmlDocument(); 18 | config.Load(fileName); 19 | 20 | var node = config.SelectSingleNode($"configuration/connectionStrings/add[@name = '{name}']")?.Attributes?["connectionString"]; 21 | node.ShouldNotBeNull(); 22 | 23 | return node.Value; 24 | } 25 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.TestApi/SqlDatabase.TestApi.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Sources/SqlDatabase.TestApi/TempConsoleOut.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.TestApi; 2 | 3 | public sealed class TempConsoleOut : IDisposable 4 | { 5 | private readonly TextWriter _originalOutput; 6 | private readonly Buffer _buffer; 7 | 8 | public TempConsoleOut() 9 | { 10 | _originalOutput = Console.Out; 11 | _buffer = new Buffer(); 12 | Console.SetOut(_buffer); 13 | } 14 | 15 | public string GetOutput() 16 | { 17 | _buffer.Flush(); 18 | return _buffer.ToString(); 19 | } 20 | 21 | public void Dispose() 22 | { 23 | Console.SetOut(_originalOutput); 24 | } 25 | 26 | private sealed class Buffer : StringWriter, IDisposable 27 | { 28 | void IDisposable.Dispose() 29 | { 30 | Flush(); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.TestApi/TempFile.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.TestApi; 2 | 3 | public sealed class TempFile : IDisposable 4 | { 5 | public TempFile(string extension) 6 | { 7 | Location = Path.Combine(Path.GetTempPath(), Guid.NewGuid() + extension); 8 | } 9 | 10 | public string Location { get; } 11 | 12 | public void Dispose() 13 | { 14 | if (File.Exists(Location)) 15 | { 16 | File.Delete(Location); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.TestApi/TestOutput.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.TestApi; 2 | 3 | public static class TestOutput 4 | { 5 | [Conditional("DEBUG")] 6 | public static void WriteLine() => Console.WriteLine(); 7 | 8 | [Conditional("DEBUG")] 9 | public static void WriteLine(string? value) => Console.WriteLine(value); 10 | 11 | [Conditional("DEBUG")] 12 | public static void WriteLine(object? value) => Console.WriteLine(value); 13 | 14 | [Conditional("DEBUG")] 15 | public static void WriteLine(string format, object? arg0) => Console.WriteLine(format, arg0); 16 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.TestApi/TextExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.TestApi; 2 | 3 | public static class TextExtensions 4 | { 5 | public static Func AsFuncStream(this string text) 6 | { 7 | return () => new MemoryStream(Encoding.Default.GetBytes(text)); 8 | } 9 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/Sources/SqlDatabase.snk -------------------------------------------------------------------------------- /Sources/SqlDatabase/CodeAnalysis/AllowNullAttribute.cs: -------------------------------------------------------------------------------- 1 | #if NET472 || NETSTANDARD2_0 2 | namespace System.Diagnostics.CodeAnalysis; 3 | 4 | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)] 5 | internal sealed class AllowNullAttribute : Attribute 6 | { 7 | } 8 | #endif -------------------------------------------------------------------------------- /Sources/SqlDatabase/CodeAnalysis/NotNullWhenAttribute.cs: -------------------------------------------------------------------------------- 1 | #if NET472 || NETSTANDARD2_0 2 | namespace System.Diagnostics.CodeAnalysis; 3 | 4 | internal sealed class NotNullWhenAttribute : Attribute 5 | { 6 | public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue; 7 | 8 | public bool ReturnValue { get; } 9 | } 10 | #endif 11 | -------------------------------------------------------------------------------- /Sources/SqlDatabase/Commands/DatabaseCommandBase.cs: -------------------------------------------------------------------------------- 1 | using SqlDatabase.Adapter; 2 | using SqlDatabase.Scripts; 3 | 4 | namespace SqlDatabase.Commands; 5 | 6 | internal abstract class DatabaseCommandBase : ICommand 7 | { 8 | protected DatabaseCommandBase(IDatabase database, ILogger log) 9 | { 10 | Database = database; 11 | Log = log; 12 | } 13 | 14 | public ILogger Log { get; } 15 | 16 | public IDatabase Database { get; } 17 | 18 | public void Execute() 19 | { 20 | Greet(Database.Adapter.GetUserFriendlyConnectionString()); 21 | Log.Info(GetServerVersion()); 22 | 23 | ExecuteCore(); 24 | } 25 | 26 | protected abstract void Greet(string databaseLocation); 27 | 28 | protected abstract void ExecuteCore(); 29 | 30 | protected virtual string GetServerVersion() => Database.GetServerVersion(false); 31 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase/Commands/ICommand.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Commands; 2 | 3 | internal interface ICommand 4 | { 5 | void Execute(); 6 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase/Configuration/CommandLine.txt: -------------------------------------------------------------------------------- 1 | Usage: SqlDatabase [options]... 2 | 3 | 4 | create: create a database 5 | upgrade: upgrade an existing database 6 | execute: execute script file(s) 7 | export: export data from a database 8 | 9 | Run 'SqlDatabase -help' for more information on a command. -------------------------------------------------------------------------------- /Sources/SqlDatabase/Configuration/IEnvironmentBuilder.cs: -------------------------------------------------------------------------------- 1 | using SqlDatabase.Adapter; 2 | using SqlDatabase.Scripts; 3 | 4 | namespace SqlDatabase.Configuration; 5 | 6 | internal interface IEnvironmentBuilder 7 | { 8 | IEnvironmentBuilder WithConfiguration(string? configurationFile); 9 | 10 | IEnvironmentBuilder WithLogger(ILogger logger); 11 | 12 | IEnvironmentBuilder WithPowerShellScripts(string? installationPath); 13 | 14 | IEnvironmentBuilder WithAssemblyScripts(); 15 | 16 | IEnvironmentBuilder WithVariables(IDictionary variables); 17 | 18 | IEnvironmentBuilder WithDataBase(string connectionString, TransactionMode transaction, bool whatIf); 19 | 20 | IDatabase BuildDatabase(); 21 | 22 | IScriptResolver BuildScriptResolver(); 23 | 24 | IScriptFactory BuildScriptFactory(); 25 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase/ExitCode.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase; 2 | 3 | internal static class ExitCode 4 | { 5 | public const int Ok = 0; 6 | 7 | public const int InvalidCommandLine = 1; 8 | 9 | public const int ExecutionErrors = 2; 10 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase/Log/ConsoleLogger.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Log; 2 | 3 | internal sealed class ConsoleLogger : LoggerBase 4 | { 5 | protected override void WriteError(string message) 6 | { 7 | var color = Console.ForegroundColor; 8 | Console.ForegroundColor = ConsoleColor.Red; 9 | 10 | Console.WriteLine(message); 11 | 12 | Console.ForegroundColor = color; 13 | } 14 | 15 | protected override void WriteInfo(string message) 16 | { 17 | Console.WriteLine(message); 18 | } 19 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase/Log/DisposableAction.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Log; 2 | 3 | internal sealed class DisposableAction : IDisposable 4 | { 5 | private Action? _action; 6 | 7 | public DisposableAction(Action action) 8 | { 9 | _action = action; 10 | } 11 | 12 | public void Dispose() 13 | { 14 | var a = _action; 15 | _action = null; 16 | a?.Invoke(); 17 | } 18 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase/Log/LoggerFactory.cs: -------------------------------------------------------------------------------- 1 | using SqlDatabase.Adapter; 2 | 3 | namespace SqlDatabase.Log; 4 | 5 | internal static class LoggerFactory 6 | { 7 | public static ILogger CreateDefault() 8 | { 9 | return new ConsoleLogger(); 10 | } 11 | 12 | public static ILogger WrapWithUsersLogger(ILogger logger, string? fileName) 13 | { 14 | if (string.IsNullOrEmpty(fileName)) 15 | { 16 | return logger; 17 | } 18 | 19 | ILogger fileLogger; 20 | try 21 | { 22 | fileLogger = new FileLogger(fileName!); 23 | } 24 | catch (Exception ex) 25 | { 26 | throw new InvalidOperationException("Fail to create file log.", ex); 27 | } 28 | 29 | return new CombinedLogger(logger, false, fileLogger, true); 30 | } 31 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase/Scripts/IDatabase.cs: -------------------------------------------------------------------------------- 1 | using SqlDatabase.Adapter; 2 | 3 | namespace SqlDatabase.Scripts; 4 | 5 | internal interface IDatabase 6 | { 7 | IDatabaseAdapter Adapter { get; } 8 | 9 | string GetServerVersion(bool useMasterDatabase); 10 | 11 | Version GetCurrentVersion(string? moduleName); 12 | 13 | void Execute(IScript script, string moduleName, Version currentVersion, Version targetVersion); 14 | 15 | void Execute(IScript script); 16 | 17 | void ExecuteWithDatabaseCheck(IScript script); 18 | 19 | IEnumerable ExecuteReader(IScript script); 20 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase/Scripts/IScriptResolver.cs: -------------------------------------------------------------------------------- 1 | using SqlDatabase.Adapter; 2 | 3 | namespace SqlDatabase.Scripts; 4 | 5 | internal interface IScriptResolver 6 | { 7 | void InitializeEnvironment(ILogger logger, IEnumerable scripts); 8 | } -------------------------------------------------------------------------------- /Sources/SqlDatabase/Scripts/VariableSource.cs: -------------------------------------------------------------------------------- 1 | namespace SqlDatabase.Scripts; 2 | 3 | public enum VariableSource 4 | { 5 | Runtime, 6 | 7 | CommandLine, 8 | 9 | Environment, 10 | 11 | ConfigurationFile 12 | } -------------------------------------------------------------------------------- /Sources/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "9.0.100-rc.2.24474.11", 4 | "allowPrerelease": true, 5 | "rollForward": "latestFeature" 6 | } 7 | } -------------------------------------------------------------------------------- /Sources/nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Sources/stylecop.json: -------------------------------------------------------------------------------- 1 | { 2 | //"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json" 3 | "settings": { 4 | "orderingRules": { 5 | "systemUsingDirectivesFirst": true 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /icon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/max-ieremenko/SqlDatabase/64ada59ca7d6540c5c9d9c19a8439c2b05471dcc/icon-32.png --------------------------------------------------------------------------------