EntityFrameworkCore.MySqlUpdater 1.0.12

dotnet add package EntityFrameworkCore.MySqlUpdater --version 1.0.12
NuGet\Install-Package EntityFrameworkCore.MySqlUpdater -Version 1.0.12
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EntityFrameworkCore.MySqlUpdater" Version="1.0.12" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EntityFrameworkCore.MySqlUpdater --version 1.0.12
#r "nuget: EntityFrameworkCore.MySqlUpdater, 1.0.12"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install EntityFrameworkCore.MySqlUpdater as a Cake Addin
#addin nuget:?package=EntityFrameworkCore.MySqlUpdater&version=1.0.12

// Install EntityFrameworkCore.MySqlUpdater as a Cake Tool
#tool nuget:?package=EntityFrameworkCore.MySqlUpdater&version=1.0.12

EntityFrameworkCore.MySqlUpdater

An entity core framework extension package, to auto apply sql files.

Installation

Use one of these possibilities to add the package to your project.

Install-Package EntityFrameworkCore.MySqlUpdater

dotnet add package EntityFrameworkCore.MySqlUpdater

<PackageReference Include="EntityFrameworkCore.MySqlUpdater"" />

paket add EntityFrameworkCore.MySqlUpdater

Idea

The idea behind this package is to extend EFCore with an auto updater for mysql databases. It is tedious to apply single sql files one by one, and even if you put them together in one big file you most likely can execute them more than once, because of update queries which will fail. This package introduces convenience functions to apply sql files, keep track of already applied files and executing single sql files. This package is not meant to be used for executing sql files that are not in your direct control. So never use it with queries that are vulnerable to sql injection attacks etc.

Usage

The package is using a database table called updates, to store hashsums of applied files to your database. The updates folder contains information about the date and speed of execution, as well as the filename and the SHA hash.
We will refer to the system as HashSumTracker.
This HashSumTracker is used to prevent multiple executions of already applied sql files. This will cause issue if your sql files, contain update statements.


Example

One intended example workflow can be described as the following. A server is setup and at startup one can call the ApplyBaseFile function. This function will check if the schema is already populated. If it is populated it will return without executing the sql file. If the schema is empty ( table count == 0), the sql will be apllied. After the sql base file is applied, one can call ApplyUpdates(List of update folders). The package will iterate through all folders, trying to execute every sql file to your db. It is trying, because if you did not disable hashSumTracking, the tool is checking if the file is not already applied to your database. If the sql file is already applied, it will skip it and continue with the next one.

Available adjustable parameters:

  • Timeout: Specifies the mysql command timeout. Default = 60 seconds
  • DebugOutput: Activate/Deactivate the debugoutput. Default = false
  • Hashsumtracking: Activate/Deactivate the hashsum tracking. Default = true

Examples

Create the update table

await _context.CreateUpdatesTable().ConfigureAwait(false);

Apply all sql files from given folders.

List<string> folders = new List<string> { "PATH_TO_YOUR_FOLDER", "PATH_TO_ANOTHER_FOLDER" };
await _context.ApplyUpdates(folders, true).ConfigureAwait(false);

Apply a single file

await _context.ApplySQLFile("PATH_TO_YOUR_FILE");

Apply a base file

_context.ApplyBaseFile("YOUR_SCHAME_NAME","PATH_TO_YOUR_BASE_FILE");
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.12 712 3/29/2020