sqlinsight-pro/src/SQLInsight.Core/Instances/Capability.cs
Claude edb7410f76
Some checks are pending
CI / Integration (mcr.microsoft.com/mssql/server:2017-latest) (push) Blocked by required conditions
CI / Integration (mcr.microsoft.com/mssql/server:2019-latest) (push) Blocked by required conditions
CI / Integration (mcr.microsoft.com/mssql/server:2022-latest) (push) Blocked by required conditions
CI / Integration (mcr.microsoft.com/mssql/server:2025-latest) (push) Blocked by required conditions
CI / Build og unit tests (push) Waiting to run
Fase 2: Azure SQL Managed Instance, docs and rule catalog test
- Managed Instance reports 12.0.2000.8 but is evergreen: treated as the
  newest engine with all capabilities; new SelfManagedInfrastructure
  capability so backup, CHECKDB, files, tempdb, memory, patch level and
  lifecycle rules report 'handled by Azure' instead of false findings
- Microsoft Entra ID login (managed identity, service principal, default
  credential chain) via SqlConnection.AccessTokenCallback
- Least-privilege script recognizes Managed Instance; deadlock collector
  falls back to the ring buffer when event files cannot be read
- Web UI shows the right release for Managed Instance
- README and installation docs: notifications and Managed Instance
- Catalog test: 61 rules with unique, well-formed ids

Integration suite green on SQL Server 2017 and 2022.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E3EExwndy8Z22EK2Qpt6BK
2026-09-29 08:23:40 +00:00

64 lines
2.5 KiB
C#

namespace SQLInsight.Core.Instances;
/// <summary>
/// Something a collector or rule depends on that not every SQL Server version or configuration offers.
/// </summary>
public enum Capability
{
/// <summary>
/// The customer runs the server: backups, patching, files, tempdb and host configuration are theirs to manage.
/// Absent on Azure SQL Managed Instance, where Azure does it.
/// </summary>
SelfManagedInfrastructure,
/// <summary>Dynamic management views (<c>sys.dm_*</c>). SQL Server 2005+.</summary>
DynamicManagementViews,
/// <summary>The always-on default trace. SQL Server 2005+.</summary>
DefaultTrace,
/// <summary>The <c>VIEW SERVER STATE</c> permission, so monitoring does not need sysadmin. SQL Server 2005+.</summary>
ViewServerStatePermission,
/// <summary>Extended Events. SQL Server 2008+.</summary>
ExtendedEvents,
/// <summary>The built-in <c>system_health</c> Extended Events session (deadlock graphs). SQL Server 2008+.</summary>
SystemHealthSession,
/// <summary><c>system_health</c> writes to a file target, so history survives the ring buffer. SQL Server 2012+.</summary>
SystemHealthFileTarget,
/// <summary>Always On availability group DMVs exist. SQL Server 2012+.</summary>
AvailabilityGroupDmvs,
/// <summary>Always On is enabled on this instance (runtime setting, not just the version).</summary>
HadrEnabled,
/// <summary>The <c>CONNECT ANY DATABASE</c> permission. SQL Server 2014+.</summary>
ConnectAnyDatabasePermission,
/// <summary>Query Store. SQL Server 2016+.</summary>
QueryStore,
/// <summary><c>sys.dm_exec_session_wait_stats</c>. SQL Server 2016+.</summary>
SessionWaitStats,
/// <summary><c>DATABASEPROPERTYEX(..., 'LastGoodCheckDbTime')</c>, so CHECKDB status does not need sysadmin. SQL Server 2016 SP2+.</summary>
LastGoodCheckDbTime,
/// <summary><c>sys.dm_db_log_info</c>, so VLFs can be counted without sysadmin. SQL Server 2016 SP2+.</summary>
LogInfoDmv,
/// <summary>
/// Memory grant and spill columns in <c>sys.dm_exec_query_stats</c> (total_grant_kb, total_spills …).
/// SQL Server 2016 SP2+ and 2017 CU3+.
/// </summary>
QueryStatsMemoryColumns,
/// <summary><c>sys.dm_exec_query_plan_stats</c> (last actual execution plan). SQL Server 2019+.</summary>
LastActualPlan,
/// <summary>Granular server permissions such as <c>VIEW SERVER PERFORMANCE STATE</c>. SQL Server 2022+.</summary>
GranularServerPermissions,
}