Holmes 5.0.116

dotnet add package Holmes --version 5.0.116
                    
NuGet\Install-Package Holmes -Version 5.0.116
                    
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="Holmes" Version="5.0.116" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Holmes" Version="5.0.116" />
                    
Directory.Packages.props
<PackageReference Include="Holmes" />
                    
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 Holmes --version 5.0.116
                    
#r "nuget: Holmes, 5.0.116"
                    
#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 Holmes@5.0.116
                    
#: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=Holmes&version=5.0.116
                    
Install as a Cake Addin
#tool nuget:?package=Holmes&version=5.0.116
                    
Install as a Cake Tool

Holmes

Build status

Holmes is a database analysis library. It scans a database and returns suggestions for improvement. Supports .Net Core as well as full .Net

Setting Up the Library

In order to use Holmes, you need to start by wiring it up on your ServiceCollection. However this takes just one extension method call:

serviceCollection.AddCanisterModules();
				

When this is done, Holmes is ready to use.

Basic Usage

The main class of interest is the Sherlock class:

var Results = Sherlock.Analyze(new Connection(...));

The Sherlock class contains one function which is Analyze. This function takes a Connection object defining where the library should be pointed. It will then, based on the provider specified in the connection object, run any analysis classes that it has and returns a list of Finding objects. The Finding class looks like this:

public class Finding
{
	public string Fix { get; }
	public IDictionary<string, object> Metrics { get; }
	public string Text { get; }
}

The Text property contains the explination of what was found, the Metrics property contains the data that was returned by the analysis object, and the Fix property contains the SQL command that can be used to remedy the issue. Note that not all analysis classes will contain a suggested fix. This is optional where as the other two properties will always contain some information.

Adding Your Own Analyzer

The system a couple of built in analyzers:

  • SQL Server
    • Recent expensive queries
    • Missing indexes
    • Overlapping indexes
    • Unused indexes

However you can easily add your own analyzer by simply creating a class that inherits from IAnalyzer. The system will then pick it up automatically and run it as well. For simple analyzers there is also an AnalyzerBaseClass that will simplify the process of setting up your analyzer. The IAnalyzer interface itself is rather simple though:

public interface IAnalyzer
{
    /// <summary>
    /// Gets the factory the analyzer supports.
    /// </summary>
    /// <value>Gets the factory the analyzer supports.</value>
    DbProviderFactory SupportedFactory { get; }

    /// <summary>
    /// Adds the query the analyzer needs to the batch.
    /// </summary>
    /// <param name="batch">The batch.</param>
    /// <returns>This.</returns>
    IAnalyzer AddQuery(SQLHelper.SQLHelper batch);

    /// <summary>
    /// Analyzes the specified connection's source database.
    /// </summary>
    /// <param name="results">The results of the analysis.</param>
    /// <returns>The list of suggestions for the database.</returns>
    IEnumerable<Finding> Analyze(IEnumerable<dynamic> results);
}

The SupportedFactory property is the DbProviderFactory that this analyzer should be run against. All analyzer queries are batched together by the system and run at once. As such there is an AddQuery function. With this function the system passes you the SQLHelper object it is using to batch the various queries. The one method on that you will probably use is AddQuery. The only other method is Analyze. This method recieves the results of the query as a list of dynamic objects. The names of each property is the same as the result set of the query you specified previously. In turn you should return a list of Finding objects.

Installation

The library is available via Nuget with the package name "Holmes". To install it run the following command in the Package Manager Console:

Install-Package Holmes

Build Process

In order to build the library you will require the following:

  1. Visual Studio 2022

Other than that, just clone the project and you should be able to load the solution and build without too much effort.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  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 (1)

Showing the top 1 NuGet packages that depend on Holmes:

Package Downloads
Inflatable

Inflatable is a simple ORM.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.0.116 63 2/5/2026
5.0.115 60 2/4/2026
5.0.114 144 2/3/2026
5.0.113 75 2/3/2026
5.0.112 136 2/3/2026
5.0.111 238 1/21/2026
5.0.110 142 1/20/2026
5.0.109 150 1/19/2026
5.0.108 96 1/17/2026
5.0.107 94 1/17/2026
5.0.106 254 1/8/2026
5.0.105 97 1/8/2026
5.0.104 288 12/24/2025
5.0.103 219 12/23/2025
5.0.102 217 12/22/2025
5.0.101 222 12/11/2025
5.0.100 472 12/10/2025
5.0.99 503 12/9/2025
5.0.98 762 12/2/2025
5.0.97 685 12/2/2025
5.0.96 685 12/2/2025
5.0.95 575 11/18/2025
5.0.94 257 11/14/2025
5.0.93 231 11/14/2025
5.0.92 347 11/13/2025
5.0.91 345 11/13/2025
5.0.90 345 11/13/2025
5.0.89 277 11/6/2025
5.0.88 226 10/31/2025
5.0.87 309 10/17/2025
5.0.86 243 10/16/2025
5.0.85 234 10/15/2025
5.0.84 298 10/14/2025
5.0.83 238 10/13/2025
5.0.82 281 10/12/2025
5.0.81 307 9/30/2025
5.0.80 248 9/30/2025
5.0.79 195 9/30/2025
5.0.78 200 9/30/2025
5.0.77 292 9/25/2025
5.0.76 418 9/18/2025
5.0.75 390 9/17/2025
5.0.74 368 9/16/2025
5.0.73 248 9/11/2025
5.0.72 233 9/10/2025
5.0.71 237 9/9/2025
5.0.70 401 8/20/2025
5.0.69 212 8/20/2025
5.0.68 207 8/20/2025
5.0.67 207 8/19/2025
5.0.66 207 8/19/2025
5.0.65 207 8/19/2025
5.0.64 260 8/15/2025
5.0.63 378 8/6/2025
5.0.62 329 8/5/2025
5.0.61 292 8/5/2025
5.0.60 295 8/5/2025
5.0.59 306 8/5/2025
5.0.58 288 8/5/2025
5.0.57 264 8/1/2025
5.0.56 298 7/29/2025
5.0.55 176 7/29/2025
5.0.54 273 7/17/2025
5.0.53 258 7/16/2025
5.0.52 261 7/15/2025
5.0.51 213 7/15/2025
5.0.50 217 7/15/2025
5.0.49 248 7/8/2025
5.0.48 370 7/1/2025
5.0.47 217 7/1/2025
5.0.46 220 7/1/2025
5.0.45 261 6/28/2025
5.0.44 152 6/27/2025
5.0.43 279 6/27/2025
5.0.42 282 6/26/2025
5.0.41 257 6/18/2025
5.0.40 372 6/10/2025
5.0.39 165 5/30/2025
5.0.38 171 5/23/2025
5.0.37 314 5/14/2025
5.0.36 174 5/2/2025
5.0.35 257 4/29/2025
5.0.34 291 4/10/2025
5.0.33 249 3/17/2025
5.0.32 210 2/24/2025
5.0.31 235 2/13/2025
5.0.30 358 2/3/2025
5.0.29 250 1/30/2025
5.0.28 217 1/29/2025
5.0.27 212 1/29/2025
5.0.26 231 1/28/2025
5.0.25 232 1/24/2025
5.0.24 227 1/23/2025
5.0.23 238 1/22/2025
5.0.22 227 1/16/2025
5.0.21 215 1/15/2025
5.0.20 171 1/14/2025
5.0.19 182 1/13/2025
5.0.18 200 1/10/2025
5.0.17 191 1/9/2025
5.0.16 154 1/8/2025
5.0.15 284 12/17/2024
5.0.14 237 12/16/2024
5.0.13 246 12/10/2024
5.0.12 242 12/9/2024
5.0.11 242 12/6/2024
5.0.10 278 11/27/2024
5.0.9 204 11/26/2024
5.0.8 256 11/26/2024
5.0.7 249 11/24/2024
5.0.6 197 11/24/2024
5.0.5 202 11/23/2024
5.0.4 192 11/23/2024
4.0.270 222 11/19/2024
4.0.269 204 11/11/2024
4.0.268 200 11/7/2024
4.0.267 192 11/5/2024
4.0.266 195 11/4/2024
4.0.265 222 11/1/2024
4.0.264 202 11/1/2024
4.0.263 204 10/30/2024
4.0.262 208 10/29/2024
4.0.261 205 10/29/2024
4.0.260 215 10/26/2024
4.0.259 213 10/24/2024
4.0.258 216 10/21/2024
4.0.257 215 10/17/2024
4.0.256 199 10/15/2024
4.0.255 209 10/11/2024
4.0.254 196 10/10/2024
4.0.253 211 10/9/2024
4.0.252 230 10/9/2024
4.0.251 248 10/3/2024
4.0.250 220 10/2/2024
4.0.249 226 9/30/2024
4.0.248 218 9/28/2024
4.0.247 198 9/24/2024
4.0.246 219 9/23/2024
4.0.245 216 9/23/2024
4.0.244 240 9/17/2024
4.0.243 230 9/16/2024
4.0.242 229 9/10/2024
4.0.241 219 9/9/2024
4.0.240 212 9/6/2024
4.0.239 215 9/6/2024
4.0.238 222 9/3/2024
4.0.237 237 9/2/2024
4.0.236 211 8/30/2024
4.0.235 213 8/30/2024
4.0.234 221 8/28/2024
4.0.233 225 8/27/2024
4.0.232 210 8/26/2024
4.0.231 249 8/24/2024
4.0.230 234 8/23/2024
4.0.229 245 8/21/2024
4.0.228 240 8/21/2024
4.0.227 230 8/20/2024
4.0.226 225 8/19/2024
4.0.225 239 8/16/2024
4.0.224 237 8/16/2024
4.0.223 256 8/14/2024
4.0.222 242 8/5/2024
4.0.221 193 8/2/2024
4.0.220 198 8/1/2024
4.0.219 200 7/31/2024
4.0.218 224 7/26/2024
4.0.217 225 7/25/2024
4.0.216 196 7/25/2024
4.0.215 226 7/11/2024
4.0.214 237 7/10/2024
4.0.213 236 7/9/2024
4.0.212 208 7/9/2024
4.0.211 232 7/9/2024
4.0.210 211 7/5/2024
4.0.209 224 7/4/2024
4.0.208 246 7/3/2024
4.0.207 225 7/2/2024
4.0.206 237 6/27/2024
4.0.205 229 6/26/2024
4.0.204 228 6/25/2024
4.0.203 228 6/24/2024
4.0.202 1,347 6/19/2024
4.0.201 242 6/19/2024
4.0.200 224 6/17/2024
4.0.199 225 6/14/2024
4.0.198 220 6/14/2024
4.0.197 216 6/12/2024
4.0.196 234 6/3/2024
4.0.195 218 5/31/2024
4.0.194 194 5/30/2024
4.0.193 225 5/29/2024
4.0.192 211 5/28/2024
4.0.191 214 5/27/2024
4.0.190 210 5/23/2024
4.0.189 221 5/22/2024
4.0.188 224 5/21/2024
4.0.187 238 5/20/2024
4.0.186 237 5/18/2024
4.0.185 228 5/16/2024
4.0.184 230 5/15/2024
4.0.183 236 5/8/2024
4.0.182 250 5/7/2024
4.0.181 255 5/6/2024
4.0.180 219 5/3/2024
4.0.179 941 5/2/2024
4.0.178 211 5/2/2024
4.0.177 224 5/1/2024
4.0.176 235 4/29/2024
4.0.175 222 4/29/2024
4.0.174 246 4/25/2024
4.0.173 243 4/24/2024
4.0.172 236 4/16/2024
4.0.171 228 4/15/2024
4.0.170 248 4/13/2024
4.0.169 206 4/12/2024
4.0.168 226 4/11/2024
4.0.167 235 4/10/2024
4.0.166 224 4/9/2024
4.0.165 247 4/9/2024
4.0.164 232 4/1/2024
4.0.163 227 3/29/2024
4.0.162 240 3/29/2024
4.0.161 234 3/27/2024
4.0.160 219 3/22/2024
4.0.159 240 3/22/2024
4.0.158 256 3/18/2024
4.0.157 244 3/15/2024
4.0.156 238 3/14/2024
4.0.155 228 3/14/2024
4.0.154 229 3/11/2024
4.0.153 247 3/8/2024
4.0.152 241 3/7/2024
4.0.151 255 3/6/2024
4.0.150 278 3/5/2024
4.0.149 255 3/4/2024
4.0.148 1,378 3/2/2024
4.0.147 251 2/29/2024
4.0.146 222 2/29/2024
4.0.145 238 2/27/2024
4.0.144 223 2/26/2024
4.0.143 224 2/23/2024
4.0.142 241 2/22/2024
4.0.141 240 2/22/2024
4.0.140 232 2/21/2024
4.0.139 246 2/20/2024
4.0.138 250 2/19/2024
4.0.137 226 2/19/2024
4.0.136 239 2/16/2024
4.0.135 234 2/16/2024
4.0.134 239 2/15/2024
4.0.133 258 2/14/2024
4.0.132 223 2/14/2024
4.0.131 234 2/13/2024
4.0.130 268 2/9/2024
4.0.129 244 2/9/2024
4.0.128 226 2/7/2024
4.0.127 227 2/6/2024
4.0.126 235 2/6/2024
4.0.125 231 2/5/2024
4.0.124 233 2/3/2024
4.0.123 232 2/1/2024
4.0.122 219 2/1/2024
4.0.121 225 1/31/2024
4.0.120 241 1/29/2024
4.0.119 222 1/25/2024
4.0.118 230 1/24/2024
4.0.117 230 1/23/2024
4.0.116 234 1/22/2024
4.0.115 1,499 1/17/2024
4.0.114 206 1/16/2024
4.0.113 217 1/15/2024
4.0.112 217 1/12/2024
4.0.111 244 1/11/2024
4.0.110 250 1/10/2024
4.0.109 498 1/8/2024
4.0.108 257 1/6/2024
4.0.107 422 12/26/2023
4.0.106 223 12/26/2023
4.0.105 226 12/26/2023
4.0.104 257 12/25/2023
4.0.103 233 12/23/2023
4.0.102 238 12/21/2023
4.0.101 251 12/15/2023
4.0.100 238 12/14/2023
4.0.99 238 12/13/2023
4.0.98 244 12/13/2023
4.0.97 703 12/12/2023
4.0.96 226 12/12/2023
4.0.95 222 12/12/2023
4.0.94 227 12/11/2023
4.0.93 275 12/6/2023
4.0.92 210 12/6/2023
4.0.91 217 12/6/2023
4.0.90 204 12/4/2023
4.0.89 391 11/24/2023
4.0.88 219 11/24/2023
4.0.87 230 11/21/2023
4.0.86 224 11/20/2023
4.0.85 198 11/20/2023
4.0.84 275 11/17/2023
4.0.83 727 11/17/2023
4.0.82 221 11/15/2023
4.0.81 216 11/13/2023
4.0.80 262 11/9/2023
4.0.79 276 11/9/2023
4.0.78 187 11/8/2023
4.0.77 213 11/7/2023
4.0.76 225 11/6/2023
4.0.75 248 11/3/2023
4.0.74 267 11/2/2023
4.0.73 223 11/1/2023
4.0.72 255 10/31/2023
4.0.71 206 10/31/2023
4.0.70 204 10/30/2023
4.0.69 249 10/28/2023
4.0.68 242 10/26/2023
4.0.67 234 10/25/2023
4.0.66 244 10/17/2023
4.0.65 233 10/16/2023
4.0.64 206 10/16/2023
4.0.63 246 10/13/2023
4.0.62 255 10/12/2023
4.0.61 243 10/11/2023
4.0.60 281 10/5/2023
4.0.59 226 10/4/2023
4.0.58 263 9/26/2023
4.0.57 243 9/26/2023
4.0.56 247 9/22/2023
4.0.55 244 9/20/2023
4.0.54 246 9/19/2023
4.0.53 254 9/18/2023
4.0.52 222 9/18/2023
4.0.51 287 9/15/2023
4.0.50 254 9/14/2023
4.0.49 243 9/12/2023
4.0.48 319 9/12/2023
4.0.47 235 9/11/2023
4.0.46 264 9/11/2023
4.0.45 405 9/7/2023
4.0.44 273 9/6/2023
4.0.43 314 9/5/2023
4.0.42 269 9/4/2023
4.0.41 242 9/4/2023
4.0.40 304 9/1/2023
4.0.39 297 8/31/2023
4.0.38 297 8/31/2023
4.0.37 294 8/29/2023
4.0.36 262 8/29/2023
4.0.35 303 8/29/2023
4.0.34 320 8/25/2023
4.0.33 300 8/24/2023
4.0.32 298 8/23/2023
4.0.31 289 8/22/2023
4.0.30 295 8/18/2023
4.0.29 272 8/17/2023
4.0.28 318 8/17/2023
4.0.27 255 8/17/2023
4.0.26 393 8/10/2023
4.0.25 315 8/9/2023
4.0.24 320 8/8/2023
4.0.23 290 8/8/2023
4.0.22 275 8/8/2023
4.0.21 408 8/7/2023
4.0.20 305 8/4/2023
4.0.19 375 8/3/2023
4.0.18 309 8/2/2023
4.0.17 343 7/26/2023
4.0.16 349 7/25/2023
4.0.15 338 7/21/2023
4.0.14 315 7/19/2023
4.0.13 307 7/18/2023
4.0.12 275 7/18/2023
4.0.11 350 7/18/2023
4.0.10 271 7/18/2023
4.0.9 398 7/17/2023
4.0.8 295 7/17/2023
4.0.7 278 7/17/2023
4.0.6 283 7/17/2023
4.0.5 639 1/30/2023
4.0.4 399 1/30/2023
4.0.3 513 1/30/2023
4.0.2 514 1/27/2023
4.0.1 701 12/13/2022
4.0.0 445 12/12/2022
3.0.43 1,691 6/10/2022
3.0.41 1,097 4/20/2022
3.0.40 1,164 1/11/2022
3.0.39 929 1/10/2022
3.0.38 1,218 6/17/2021
3.0.37 917 6/16/2021
3.0.36 867 6/16/2021
3.0.35 640 6/16/2021
3.0.34 614 6/16/2021
3.0.33 1,138 1/7/2021
3.0.32 959 12/16/2020
3.0.31 896 12/14/2020
3.0.29 2,599 9/13/2020
3.0.28 1,061 6/19/2020
3.0.27 1,055 6/8/2020
3.0.26 1,814 5/12/2020
3.0.25 1,596 5/12/2020
3.0.24 1,059 4/28/2020
3.0.23 1,038 4/24/2020
3.0.22 1,046 4/16/2020
3.0.21 1,059 4/16/2020
3.0.20 759 4/15/2020
3.0.19 755 4/15/2020
3.0.18 1,300 4/14/2020
3.0.17 749 4/14/2020
3.0.16 1,103 4/10/2020
3.0.15 1,099 4/10/2020
3.0.14 3,268 3/26/2020
3.0.13 1,032 3/26/2020
3.0.12 772 3/25/2020
3.0.11 742 3/25/2020
3.0.10 745 3/25/2020
3.0.9 793 3/25/2020
3.0.8 784 3/25/2020
3.0.7 1,284 3/25/2020
3.0.6 1,472 3/21/2020
3.0.5 1,796 3/13/2020
3.0.4 799 3/13/2020
3.0.3 1,527 2/28/2020
3.0.2 1,328 2/21/2020
3.0.1 834 2/11/2020
3.0.0 2,030 12/23/2019
2.0.10 1,246 4/17/2019
2.0.9 1,779 2/21/2019
2.0.8 921 2/21/2019
2.0.7 4,324 8/1/2018
2.0.6 1,553 8/1/2018
2.0.5 1,885 6/26/2018
2.0.4 2,146 6/1/2018
2.0.3 2,098 5/22/2018
2.0.2 2,668 5/11/2018
2.0.1 2,712 2/13/2018
2.0.0 2,675 1/2/2018
1.0.10 14,730 6/16/2017
1.0.8 1,417 6/16/2017
1.0.7 1,396 5/30/2017
1.0.6 1,369 5/30/2017
1.0.5 1,377 5/25/2017
1.0.4 1,395 5/24/2017
1.0.0 1,428 5/24/2017