< Summary

Information
Class: OzonRepositories.Utils.St2MariaDb
Assembly: OzonRepositories
File(s): /home/runner/work/Studio2Prod/Studio2Prod/OzonRepositories/Utils/St2MariaDb.cs
Line coverage
14%
Covered lines: 1
Uncovered lines: 6
Coverable lines: 7
Total lines: 32
Line coverage: 14.2%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.cctor()100%11100%
BuildConnectionString(...)0%620%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/OzonRepositories/Utils/St2MariaDb.cs

#LineLine coverage
 1using Microsoft.EntityFrameworkCore;
 2using Pomelo.EntityFrameworkCore.MySql.Infrastructure;
 3
 4namespace OzonRepositories.Utils;
 5
 6/// <summary>
 7/// MariaDB 11.4 на Volna (192.168.1.130) — целевая СУБД для ветки local-deploy.
 8/// Pomelo: явная версия вместо MySQL 8.0 AutoDetect.
 9/// </summary>
 10public static class St2MariaDb
 11{
 12    public const string Host = "192.168.1.130";
 13    public const int Port = 3306;
 14    public const string AppUser = "studio";
 15
 116    public static readonly ServerVersion ServerVersion = new MariaDbServerVersion(new Version(11, 4, 12));
 17
 18    public static string BuildConnectionString(
 19        string database,
 20        string user,
 21        string password,
 22        string? extra = null)
 23    {
 024        var u = user;
 025        var p = password;
 026        var tail = string.IsNullOrWhiteSpace(extra)
 027            ? "Allow User Variables=true;AllowPublicKeyRetrieval=True;SslMode=None;"
 028            : extra.TrimEnd(';') + ";";
 29
 030        return $"Server={Host};Port={Port};Database={database};User={u};Password={p};{tail}";
 31    }
 32}