B2A.DbTula.Infrastructure.MySql 1.1.3

dotnet add package B2A.DbTula.Infrastructure.MySql --version 1.1.3
                    
NuGet\Install-Package B2A.DbTula.Infrastructure.MySql -Version 1.1.3
                    
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="B2A.DbTula.Infrastructure.MySql" Version="1.1.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="B2A.DbTula.Infrastructure.MySql" Version="1.1.3" />
                    
Directory.Packages.props
<PackageReference Include="B2A.DbTula.Infrastructure.MySql" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add B2A.DbTula.Infrastructure.MySql --version 1.1.3
                    
#r "nuget: B2A.DbTula.Infrastructure.MySql, 1.1.3"
                    
#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.
#:package B2A.DbTula.Infrastructure.MySql@1.1.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=B2A.DbTula.Infrastructure.MySql&version=1.1.3
                    
Install as a Cake Addin
#tool nuget:?package=B2A.DbTula.Infrastructure.MySql&version=1.1.3
                    
Install as a Cake Tool

🟢 B2A.DbTula.Infrastructure.MySql

Overview

DBTula MySQL Infrastructure is a provider package for B2A.DbTula.Core, enabling full-featured schema comparison and script generation for MySQL databases.

  • Implements IDatabaseSchemaProvider for MySQL
  • Uses robust query logic for tables, columns, keys, indexes, functions, and procedures
  • Returns full schema definitions and create scripts via high-level API
  • Ready for local tools, automation, and pipelines

🚀 Installation

Install via NuGet (in addition to the Core package):

dotnet add package B2A.DbTula.Core
dotnet add package B2A.DbTula.Infrastructure.MySql

✨ Features

  • MySQL Schema Fetcher:
    Reads table/column metadata, PKs, FKs, indexes, routines, and DDL
  • Rich Object Model:
    Returns TableDefinition, ColumnDefinition, PrimaryKeyDefinition, ForeignKeyDefinition, and more (from Core)
  • Script Extraction:
    Extracts create scripts for tables, indexes, keys, and routines
  • Integration Ready:
    Works seamlessly with B2A.DbTula.Cli or your own app

🧑‍💻 Usage Example

using B2A.DbTula.Core.Abstractions;
using B2A.DbTula.Infrastructure.MySql;

// Configure logger as needed for your environment
Action<int, int, string, bool> logger = (code, level, msg, isError) => Console.WriteLine(msg);

var provider = new MySqlSchemaProvider(
    connectionString: "Server=localhost;Database=test;Uid=root;Pwd=pass;",
    logger: logger,
    verbose: true
);

// List tables
var tables = await provider.GetTablesAsync();

foreach (var table in tables)
{
    var definition = await provider.GetTableDefinitionAsync(table);
    Console.WriteLine($"Table: {definition.Name}");
    // ... work with definition.Columns, definition.PrimaryKeys, etc.
}

📚 Documentation

See GitHub Repository for advanced usage, CLI, and troubleshooting.



License

MIT License

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows 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.1.3 121 7/15/2025