Holmes 5.0.111

dotnet add package Holmes --version 5.0.111
                    
NuGet\Install-Package Holmes -Version 5.0.111
                    
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.111" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Holmes" Version="5.0.111" />
                    
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.111
                    
#r "nuget: Holmes, 5.0.111"
                    
#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.111
                    
#: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.111
                    
Install as a Cake Addin
#tool nuget:?package=Holmes&version=5.0.111
                    
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.111 176 1/21/2026
5.0.110 139 1/20/2026
5.0.109 147 1/19/2026
5.0.108 90 1/17/2026
5.0.107 91 1/17/2026
5.0.106 252 1/8/2026
5.0.105 95 1/8/2026
5.0.104 285 12/24/2025
5.0.103 217 12/23/2025
5.0.102 215 12/22/2025
5.0.101 218 12/11/2025
5.0.100 470 12/10/2025
5.0.99 500 12/9/2025
5.0.98 760 12/2/2025
5.0.97 682 12/2/2025
5.0.96 682 12/2/2025
5.0.95 566 11/18/2025
5.0.94 254 11/14/2025
5.0.93 229 11/14/2025
5.0.92 346 11/13/2025
5.0.91 339 11/13/2025
5.0.90 342 11/13/2025
5.0.89 274 11/6/2025
5.0.88 223 10/31/2025
5.0.87 305 10/17/2025
5.0.86 241 10/16/2025
5.0.85 233 10/15/2025
5.0.84 296 10/14/2025
5.0.83 237 10/13/2025
5.0.82 279 10/12/2025
5.0.81 305 9/30/2025
5.0.80 247 9/30/2025
5.0.79 194 9/30/2025
5.0.78 199 9/30/2025
5.0.77 287 9/25/2025
5.0.76 416 9/18/2025
5.0.75 388 9/17/2025
5.0.74 366 9/16/2025
5.0.73 247 9/11/2025
5.0.72 231 9/10/2025
5.0.71 234 9/9/2025
5.0.70 399 8/20/2025
5.0.69 209 8/20/2025
5.0.68 205 8/20/2025
5.0.67 205 8/19/2025
5.0.66 204 8/19/2025
5.0.65 204 8/19/2025
5.0.64 258 8/15/2025
5.0.63 376 8/6/2025
5.0.62 328 8/5/2025
5.0.61 291 8/5/2025
5.0.60 294 8/5/2025
5.0.59 303 8/5/2025
5.0.58 287 8/5/2025
5.0.57 262 8/1/2025
5.0.56 291 7/29/2025
5.0.55 175 7/29/2025
5.0.54 272 7/17/2025
5.0.53 255 7/16/2025
5.0.52 260 7/15/2025
5.0.51 211 7/15/2025
5.0.50 215 7/15/2025
5.0.49 245 7/8/2025
5.0.48 367 7/1/2025
5.0.47 214 7/1/2025
5.0.46 219 7/1/2025
5.0.45 259 6/28/2025
5.0.44 151 6/27/2025
5.0.43 277 6/27/2025
5.0.42 281 6/26/2025
5.0.41 255 6/18/2025
5.0.40 371 6/10/2025
5.0.39 162 5/30/2025
5.0.38 170 5/23/2025
5.0.37 312 5/14/2025
5.0.36 170 5/2/2025
5.0.35 254 4/29/2025
5.0.34 289 4/10/2025
5.0.33 247 3/17/2025
5.0.32 209 2/24/2025
5.0.31 232 2/13/2025
5.0.30 353 2/3/2025
5.0.29 248 1/30/2025
5.0.28 215 1/29/2025
5.0.27 211 1/29/2025
5.0.26 228 1/28/2025
5.0.25 229 1/24/2025
5.0.24 226 1/23/2025
5.0.23 235 1/22/2025
5.0.22 226 1/16/2025
5.0.21 213 1/15/2025
5.0.20 169 1/14/2025
5.0.19 179 1/13/2025
5.0.18 198 1/10/2025
5.0.17 187 1/9/2025
5.0.16 151 1/8/2025
5.0.15 283 12/17/2024
5.0.14 236 12/16/2024
5.0.13 242 12/10/2024
5.0.12 241 12/9/2024
5.0.11 240 12/6/2024
5.0.10 276 11/27/2024
5.0.9 201 11/26/2024
5.0.8 255 11/26/2024
5.0.7 248 11/24/2024
5.0.6 195 11/24/2024
5.0.5 200 11/23/2024
5.0.4 190 11/23/2024
4.0.270 221 11/19/2024
4.0.269 203 11/11/2024
4.0.268 198 11/7/2024
4.0.267 191 11/5/2024
4.0.266 194 11/4/2024
4.0.265 220 11/1/2024
4.0.264 201 11/1/2024
4.0.263 202 10/30/2024
4.0.262 206 10/29/2024
4.0.261 203 10/29/2024
4.0.260 212 10/26/2024
4.0.259 210 10/24/2024
4.0.258 215 10/21/2024
4.0.257 214 10/17/2024
4.0.256 196 10/15/2024
4.0.255 208 10/11/2024
4.0.254 194 10/10/2024
4.0.253 208 10/9/2024
4.0.252 229 10/9/2024
4.0.251 246 10/3/2024
4.0.250 219 10/2/2024
4.0.249 224 9/30/2024
4.0.248 217 9/28/2024
4.0.247 196 9/24/2024
4.0.246 217 9/23/2024
4.0.245 215 9/23/2024
4.0.244 238 9/17/2024
4.0.243 227 9/16/2024
4.0.242 227 9/10/2024
4.0.241 218 9/9/2024
4.0.240 210 9/6/2024
4.0.239 212 9/6/2024
4.0.238 221 9/3/2024
4.0.237 236 9/2/2024
4.0.236 209 8/30/2024
4.0.235 211 8/30/2024
4.0.234 218 8/28/2024
4.0.233 224 8/27/2024
4.0.232 206 8/26/2024
4.0.231 248 8/24/2024
4.0.230 231 8/23/2024
4.0.229 241 8/21/2024
4.0.228 239 8/21/2024
4.0.227 227 8/20/2024
4.0.226 222 8/19/2024
4.0.225 236 8/16/2024
4.0.224 235 8/16/2024
4.0.223 251 8/14/2024
4.0.222 240 8/5/2024
4.0.221 191 8/2/2024
4.0.220 195 8/1/2024
4.0.219 197 7/31/2024
4.0.218 220 7/26/2024
4.0.217 223 7/25/2024
4.0.216 194 7/25/2024
4.0.215 225 7/11/2024
4.0.214 236 7/10/2024
4.0.213 234 7/9/2024
4.0.212 205 7/9/2024
4.0.211 231 7/9/2024
4.0.210 210 7/5/2024
4.0.209 222 7/4/2024
4.0.208 243 7/3/2024
4.0.207 221 7/2/2024
4.0.206 234 6/27/2024
4.0.205 224 6/26/2024
4.0.204 226 6/25/2024
4.0.203 226 6/24/2024
4.0.202 1,346 6/19/2024
4.0.201 240 6/19/2024
4.0.200 221 6/17/2024
4.0.199 224 6/14/2024
4.0.198 218 6/14/2024
4.0.197 215 6/12/2024
4.0.196 233 6/3/2024
4.0.195 217 5/31/2024
4.0.194 193 5/30/2024
4.0.193 224 5/29/2024
4.0.192 210 5/28/2024
4.0.191 213 5/27/2024
4.0.190 209 5/23/2024
4.0.189 220 5/22/2024
4.0.188 223 5/21/2024
4.0.187 236 5/20/2024
4.0.186 236 5/18/2024
4.0.185 227 5/16/2024
4.0.184 229 5/15/2024
4.0.183 235 5/8/2024
4.0.182 248 5/7/2024
4.0.181 253 5/6/2024
4.0.180 218 5/3/2024
4.0.179 940 5/2/2024
4.0.178 209 5/2/2024
4.0.177 222 5/1/2024
4.0.176 234 4/29/2024
4.0.175 220 4/29/2024
4.0.174 243 4/25/2024
4.0.173 240 4/24/2024
4.0.172 235 4/16/2024
4.0.171 226 4/15/2024
4.0.170 244 4/13/2024
4.0.169 205 4/12/2024
4.0.168 225 4/11/2024
4.0.167 233 4/10/2024
4.0.166 223 4/9/2024
4.0.165 245 4/9/2024
4.0.164 229 4/1/2024
4.0.163 224 3/29/2024
4.0.162 239 3/29/2024
4.0.161 233 3/27/2024
4.0.160 216 3/22/2024
4.0.159 236 3/22/2024
4.0.158 254 3/18/2024
4.0.157 243 3/15/2024
4.0.156 236 3/14/2024
4.0.155 227 3/14/2024
4.0.154 228 3/11/2024
4.0.153 244 3/8/2024
4.0.152 239 3/7/2024
4.0.151 252 3/6/2024
4.0.150 276 3/5/2024
4.0.149 252 3/4/2024
4.0.148 1,375 3/2/2024
4.0.147 248 2/29/2024
4.0.146 220 2/29/2024
4.0.145 236 2/27/2024
4.0.144 220 2/26/2024
4.0.143 223 2/23/2024
4.0.142 239 2/22/2024
4.0.141 237 2/22/2024
4.0.140 230 2/21/2024
4.0.139 244 2/20/2024
4.0.138 247 2/19/2024
4.0.137 224 2/19/2024
4.0.136 237 2/16/2024
4.0.135 232 2/16/2024
4.0.134 237 2/15/2024
4.0.133 256 2/14/2024
4.0.132 222 2/14/2024
4.0.131 231 2/13/2024
4.0.130 265 2/9/2024
4.0.129 243 2/9/2024
4.0.128 224 2/7/2024
4.0.127 225 2/6/2024
4.0.126 233 2/6/2024
4.0.125 228 2/5/2024
4.0.124 231 2/3/2024
4.0.123 231 2/1/2024
4.0.122 216 2/1/2024
4.0.121 224 1/31/2024
4.0.120 239 1/29/2024
4.0.119 221 1/25/2024
4.0.118 226 1/24/2024
4.0.117 228 1/23/2024
4.0.116 231 1/22/2024
4.0.115 1,496 1/17/2024
4.0.114 204 1/16/2024
4.0.113 215 1/15/2024
4.0.112 215 1/12/2024
4.0.111 241 1/11/2024
4.0.110 248 1/10/2024
4.0.109 495 1/8/2024
4.0.108 255 1/6/2024
4.0.107 419 12/26/2023
4.0.106 221 12/26/2023
4.0.105 225 12/26/2023
4.0.104 254 12/25/2023
4.0.103 231 12/23/2023
4.0.102 237 12/21/2023
4.0.101 249 12/15/2023
4.0.100 237 12/14/2023
4.0.99 236 12/13/2023
4.0.98 241 12/13/2023
4.0.97 700 12/12/2023
4.0.96 224 12/12/2023
4.0.95 220 12/12/2023
4.0.94 224 12/11/2023
4.0.93 270 12/6/2023
4.0.92 208 12/6/2023
4.0.91 216 12/6/2023
4.0.90 201 12/4/2023
4.0.89 389 11/24/2023
4.0.88 218 11/24/2023
4.0.87 228 11/21/2023
4.0.86 222 11/20/2023
4.0.85 196 11/20/2023
4.0.84 273 11/17/2023
4.0.83 725 11/17/2023
4.0.82 219 11/15/2023
4.0.81 215 11/13/2023
4.0.80 258 11/9/2023
4.0.79 273 11/9/2023
4.0.78 186 11/8/2023
4.0.77 211 11/7/2023
4.0.76 224 11/6/2023
4.0.75 246 11/3/2023
4.0.74 266 11/2/2023
4.0.73 222 11/1/2023
4.0.72 253 10/31/2023
4.0.71 203 10/31/2023
4.0.70 203 10/30/2023
4.0.69 248 10/28/2023
4.0.68 241 10/26/2023
4.0.67 232 10/25/2023
4.0.66 238 10/17/2023
4.0.65 232 10/16/2023
4.0.64 203 10/16/2023
4.0.63 245 10/13/2023
4.0.62 253 10/12/2023
4.0.61 241 10/11/2023
4.0.60 279 10/5/2023
4.0.59 223 10/4/2023
4.0.58 261 9/26/2023
4.0.57 241 9/26/2023
4.0.56 246 9/22/2023
4.0.55 242 9/20/2023
4.0.54 244 9/19/2023
4.0.53 252 9/18/2023
4.0.52 221 9/18/2023
4.0.51 285 9/15/2023
4.0.50 252 9/14/2023
4.0.49 241 9/12/2023
4.0.48 318 9/12/2023
4.0.47 234 9/11/2023
4.0.46 263 9/11/2023
4.0.45 402 9/7/2023
4.0.44 272 9/6/2023
4.0.43 310 9/5/2023
4.0.42 268 9/4/2023
4.0.41 241 9/4/2023
4.0.40 302 9/1/2023
4.0.39 294 8/31/2023
4.0.38 295 8/31/2023
4.0.37 293 8/29/2023
4.0.36 261 8/29/2023
4.0.35 300 8/29/2023
4.0.34 317 8/25/2023
4.0.33 297 8/24/2023
4.0.32 297 8/23/2023
4.0.31 287 8/22/2023
4.0.30 288 8/18/2023
4.0.29 269 8/17/2023
4.0.28 316 8/17/2023
4.0.27 252 8/17/2023
4.0.26 392 8/10/2023
4.0.25 313 8/9/2023
4.0.24 319 8/8/2023
4.0.23 289 8/8/2023
4.0.22 272 8/8/2023
4.0.21 407 8/7/2023
4.0.20 304 8/4/2023
4.0.19 374 8/3/2023
4.0.18 307 8/2/2023
4.0.17 340 7/26/2023
4.0.16 347 7/25/2023
4.0.15 337 7/21/2023
4.0.14 313 7/19/2023
4.0.13 306 7/18/2023
4.0.12 273 7/18/2023
4.0.11 348 7/18/2023
4.0.10 266 7/18/2023
4.0.9 394 7/17/2023
4.0.8 294 7/17/2023
4.0.7 274 7/17/2023
4.0.6 282 7/17/2023
4.0.5 637 1/30/2023
4.0.4 396 1/30/2023
4.0.3 511 1/30/2023
4.0.2 512 1/27/2023
4.0.1 700 12/13/2022
4.0.0 443 12/12/2022
3.0.43 1,690 6/10/2022
3.0.41 1,096 4/20/2022
3.0.40 1,164 1/11/2022
3.0.39 929 1/10/2022
3.0.38 1,217 6/17/2021
3.0.37 915 6/16/2021
3.0.36 866 6/16/2021
3.0.35 640 6/16/2021
3.0.34 614 6/16/2021
3.0.33 1,137 1/7/2021
3.0.32 958 12/16/2020
3.0.31 893 12/14/2020
3.0.29 2,598 9/13/2020
3.0.28 1,060 6/19/2020
3.0.27 1,053 6/8/2020
3.0.26 1,813 5/12/2020
3.0.25 1,596 5/12/2020
3.0.24 1,059 4/28/2020
3.0.23 1,036 4/24/2020
3.0.22 1,045 4/16/2020
3.0.21 1,056 4/16/2020
3.0.20 758 4/15/2020
3.0.19 754 4/15/2020
3.0.18 1,298 4/14/2020
3.0.17 748 4/14/2020
3.0.16 1,102 4/10/2020
3.0.15 1,097 4/10/2020
3.0.14 3,265 3/26/2020
3.0.13 1,029 3/26/2020
3.0.12 771 3/25/2020
3.0.11 741 3/25/2020
3.0.10 743 3/25/2020
3.0.9 791 3/25/2020
3.0.8 782 3/25/2020
3.0.7 1,281 3/25/2020
3.0.6 1,470 3/21/2020
3.0.5 1,794 3/13/2020
3.0.4 798 3/13/2020
3.0.3 1,526 2/28/2020
3.0.2 1,327 2/21/2020
3.0.1 832 2/11/2020
3.0.0 2,027 12/23/2019
2.0.10 1,244 4/17/2019
2.0.9 1,778 2/21/2019
2.0.8 920 2/21/2019
2.0.7 4,321 8/1/2018
2.0.6 1,551 8/1/2018
2.0.5 1,884 6/26/2018
2.0.4 2,144 6/1/2018
2.0.3 2,095 5/22/2018
2.0.2 2,666 5/11/2018
2.0.1 2,709 2/13/2018
2.0.0 2,674 1/2/2018
1.0.10 14,727 6/16/2017
1.0.8 1,414 6/16/2017
1.0.7 1,391 5/30/2017
1.0.6 1,366 5/30/2017
1.0.5 1,376 5/25/2017
1.0.4 1,393 5/24/2017
1.0.0 1,426 5/24/2017