Skip to content

Commit

Permalink
align with EF Core code
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikEJ committed Oct 7, 2024
1 parent 77275a5 commit 444dc42
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/Core/RevEng.Core.80/PatchedSqlServerDatabaseModelFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private static readonly Regex PartExtractor

private byte? _compatibilityLevel;
private EngineEdition? _engineEdition;
private string? _versionInformation;
private string? _version;

/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
Expand Down Expand Up @@ -134,7 +134,7 @@ public DatabaseModel Create(DbConnection connection, DatabaseModelFactoryOptions

_compatibilityLevel = GetCompatibilityLevel(connection);
_engineEdition = GetEngineEdition(connection);
_versionInformation = GetVersionInformation(connection);
_version = GetVersion(connection);

databaseModel.DatabaseName = connection.Database;
databaseModel.DefaultSchema = GetDefaultSchema(connection);
Expand Down Expand Up @@ -235,7 +235,7 @@ FROM sys.databases
return command.ExecuteScalar() as string;
}

static string? GetVersionInformation(DbConnection connection)
static string? GetVersion(DbConnection connection)
{
using var command = connection.CreateCommand();
command.CommandText = "SELECT @@VERSION;";
Expand Down Expand Up @@ -1537,12 +1537,8 @@ private bool SupportsTriggers()

private bool IsFullFeaturedEngineEdition()
{
if (_versionInformation != null && _versionInformation.Contains("Kusto", StringComparison.Ordinal))
{
return false;
}

return _engineEdition is not EngineEdition.SqlDataWarehouse and not EngineEdition.SqlOnDemand and not EngineEdition.DynamicsTdsEndpoint;
return _engineEdition is not EngineEdition.SqlDataWarehouse and not EngineEdition.SqlOnDemand and not EngineEdition.DynamicsTdsEndpoint
&& _version is not "Microsoft SQL Kusto";
}

private static string DisplayName(string? schema, string name)
Expand Down

0 comments on commit 444dc42

Please sign in to comment.