Holmes 5.0.69

There is a newer version of this package available.
See the version list below for details.
dotnet add package Holmes --version 5.0.69
                    
NuGet\Install-Package Holmes -Version 5.0.69
                    
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.69" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Holmes" Version="5.0.69" />
                    
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.69
                    
#r "nuget: Holmes, 5.0.69"
                    
#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.69
                    
#: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.69
                    
Install as a Cake Addin
#tool nuget:?package=Holmes&version=5.0.69
                    
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.104 249 12/24/2025
5.0.103 206 12/23/2025
5.0.102 203 12/22/2025
5.0.101 202 12/11/2025
5.0.100 456 12/10/2025
5.0.99 486 12/9/2025
5.0.98 744 12/2/2025
5.0.97 670 12/2/2025
5.0.96 667 12/2/2025
5.0.95 547 11/18/2025
5.0.94 241 11/14/2025
5.0.93 217 11/14/2025
5.0.92 336 11/13/2025
5.0.91 324 11/13/2025
5.0.90 328 11/13/2025
5.0.89 262 11/6/2025
5.0.88 210 10/31/2025
5.0.87 291 10/17/2025
5.0.86 228 10/16/2025
5.0.85 224 10/15/2025
5.0.84 282 10/14/2025
5.0.83 226 10/13/2025
5.0.82 268 10/12/2025
5.0.81 296 9/30/2025
5.0.80 233 9/30/2025
5.0.79 186 9/30/2025
5.0.78 187 9/30/2025
5.0.77 277 9/25/2025
5.0.76 404 9/18/2025
5.0.75 378 9/17/2025
5.0.74 352 9/16/2025
5.0.73 236 9/11/2025
5.0.72 217 9/10/2025
5.0.71 224 9/9/2025
5.0.70 387 8/20/2025
5.0.69 200 8/20/2025
5.0.68 198 8/20/2025
5.0.67 195 8/19/2025
5.0.66 193 8/19/2025
5.0.65 194 8/19/2025
5.0.64 248 8/15/2025
5.0.63 365 8/6/2025
5.0.62 317 8/5/2025
5.0.61 278 8/5/2025
5.0.60 281 8/5/2025
5.0.59 293 8/5/2025
5.0.58 278 8/5/2025
5.0.57 248 8/1/2025
5.0.56 270 7/29/2025
5.0.55 163 7/29/2025
5.0.54 262 7/17/2025
5.0.53 247 7/16/2025
5.0.52 252 7/15/2025
5.0.51 203 7/15/2025
5.0.50 202 7/15/2025
5.0.49 231 7/8/2025
5.0.48 355 7/1/2025
5.0.47 203 7/1/2025
5.0.46 208 7/1/2025
5.0.45 249 6/28/2025
5.0.44 136 6/27/2025
5.0.43 272 6/27/2025
5.0.42 272 6/26/2025
5.0.41 241 6/18/2025
5.0.40 357 6/10/2025
5.0.39 149 5/30/2025
5.0.38 161 5/23/2025
5.0.37 305 5/14/2025
5.0.36 159 5/2/2025
5.0.35 244 4/29/2025
5.0.34 275 4/10/2025
5.0.33 238 3/17/2025
5.0.32 198 2/24/2025
5.0.31 222 2/13/2025
5.0.30 339 2/3/2025
5.0.29 238 1/30/2025
5.0.28 204 1/29/2025
5.0.27 197 1/29/2025
5.0.26 221 1/28/2025
5.0.25 222 1/24/2025
5.0.24 217 1/23/2025
5.0.23 224 1/22/2025
5.0.22 217 1/16/2025
5.0.21 202 1/15/2025
5.0.20 161 1/14/2025
5.0.19 167 1/13/2025
5.0.18 186 1/10/2025
5.0.17 176 1/9/2025
5.0.16 141 1/8/2025
5.0.15 272 12/17/2024
5.0.14 224 12/16/2024
5.0.13 235 12/10/2024
5.0.12 225 12/9/2024
5.0.11 235 12/6/2024
5.0.10 270 11/27/2024
5.0.9 188 11/26/2024
5.0.8 245 11/26/2024
5.0.7 240 11/24/2024
5.0.6 185 11/24/2024
5.0.5 184 11/23/2024
5.0.4 174 11/23/2024
4.0.270 209 11/19/2024
4.0.269 195 11/11/2024
4.0.268 188 11/7/2024
4.0.267 179 11/5/2024
4.0.266 185 11/4/2024
4.0.265 213 11/1/2024
4.0.264 185 11/1/2024
4.0.263 192 10/30/2024
4.0.262 196 10/29/2024
4.0.261 194 10/29/2024
4.0.260 199 10/26/2024
4.0.259 197 10/24/2024
4.0.258 200 10/21/2024
4.0.257 203 10/17/2024
4.0.256 187 10/15/2024
4.0.255 199 10/11/2024
4.0.254 182 10/10/2024
4.0.253 195 10/9/2024
4.0.252 215 10/9/2024
4.0.251 235 10/3/2024
4.0.250 208 10/2/2024
4.0.249 215 9/30/2024
4.0.248 209 9/28/2024
4.0.247 186 9/24/2024
4.0.246 207 9/23/2024
4.0.245 203 9/23/2024
4.0.244 227 9/17/2024
4.0.243 220 9/16/2024
4.0.242 215 9/10/2024
4.0.241 202 9/9/2024
4.0.240 199 9/6/2024
4.0.239 198 9/6/2024
4.0.238 209 9/3/2024
4.0.237 224 9/2/2024
4.0.236 200 8/30/2024
4.0.235 197 8/30/2024
4.0.234 208 8/28/2024
4.0.233 216 8/27/2024
4.0.232 196 8/26/2024
4.0.231 236 8/24/2024
4.0.230 215 8/23/2024
4.0.229 233 8/21/2024
4.0.228 226 8/21/2024
4.0.227 215 8/20/2024
4.0.226 210 8/19/2024
4.0.225 225 8/16/2024
4.0.224 222 8/16/2024
4.0.223 236 8/14/2024
4.0.222 228 8/5/2024
4.0.221 183 8/2/2024
4.0.220 181 8/1/2024
4.0.219 188 7/31/2024
4.0.218 209 7/26/2024
4.0.217 208 7/25/2024
4.0.216 184 7/25/2024
4.0.215 213 7/11/2024
4.0.214 224 7/10/2024
4.0.213 227 7/9/2024
4.0.212 198 7/9/2024
4.0.211 218 7/9/2024
4.0.210 201 7/5/2024
4.0.209 210 7/4/2024
4.0.208 232 7/3/2024
4.0.207 206 7/2/2024
4.0.206 228 6/27/2024
4.0.205 209 6/26/2024
4.0.204 215 6/25/2024
4.0.203 216 6/24/2024
4.0.202 1,337 6/19/2024
4.0.201 224 6/19/2024
4.0.200 210 6/17/2024
4.0.199 214 6/14/2024
4.0.198 203 6/14/2024
4.0.197 207 6/12/2024
4.0.196 222 6/3/2024
4.0.195 208 5/31/2024
4.0.194 181 5/30/2024
4.0.193 211 5/29/2024
4.0.192 200 5/28/2024
4.0.191 203 5/27/2024
4.0.190 201 5/23/2024
4.0.189 211 5/22/2024
4.0.188 214 5/21/2024
4.0.187 228 5/20/2024
4.0.186 224 5/18/2024
4.0.185 214 5/16/2024
4.0.184 216 5/15/2024
4.0.183 227 5/8/2024
4.0.182 232 5/7/2024
4.0.181 237 5/6/2024
4.0.180 208 5/3/2024
4.0.179 930 5/2/2024
4.0.178 193 5/2/2024
4.0.177 211 5/1/2024
4.0.176 225 4/29/2024
4.0.175 209 4/29/2024
4.0.174 228 4/25/2024
4.0.173 229 4/24/2024
4.0.172 223 4/16/2024
4.0.171 214 4/15/2024
4.0.170 235 4/13/2024
4.0.169 197 4/12/2024
4.0.168 213 4/11/2024
4.0.167 219 4/10/2024
4.0.166 212 4/9/2024
4.0.165 233 4/9/2024
4.0.164 217 4/1/2024
4.0.163 213 3/29/2024
4.0.162 229 3/29/2024
4.0.161 224 3/27/2024
4.0.160 204 3/22/2024
4.0.159 225 3/22/2024
4.0.158 243 3/18/2024
4.0.157 229 3/15/2024
4.0.156 223 3/14/2024
4.0.155 218 3/14/2024
4.0.154 215 3/11/2024
4.0.153 231 3/8/2024
4.0.152 224 3/7/2024
4.0.151 244 3/6/2024
4.0.150 263 3/5/2024
4.0.149 241 3/4/2024
4.0.148 1,364 3/2/2024
4.0.147 239 2/29/2024
4.0.146 208 2/29/2024
4.0.145 226 2/27/2024
4.0.144 210 2/26/2024
4.0.143 214 2/23/2024
4.0.142 230 2/22/2024
4.0.141 223 2/22/2024
4.0.140 220 2/21/2024
4.0.139 231 2/20/2024
4.0.138 235 2/19/2024
4.0.137 215 2/19/2024
4.0.136 229 2/16/2024
4.0.135 215 2/16/2024
4.0.134 226 2/15/2024
4.0.133 244 2/14/2024
4.0.132 212 2/14/2024
4.0.131 216 2/13/2024
4.0.130 253 2/9/2024
4.0.129 233 2/9/2024
4.0.128 208 2/7/2024
4.0.127 210 2/6/2024
4.0.126 224 2/6/2024
4.0.125 220 2/5/2024
4.0.124 220 2/3/2024
4.0.123 218 2/1/2024
4.0.122 208 2/1/2024
4.0.121 213 1/31/2024
4.0.120 227 1/29/2024
4.0.119 209 1/25/2024
4.0.118 216 1/24/2024
4.0.117 215 1/23/2024
4.0.116 220 1/22/2024
4.0.115 1,486 1/17/2024
4.0.114 194 1/16/2024
4.0.113 203 1/15/2024
4.0.112 209 1/12/2024
4.0.111 227 1/11/2024
4.0.110 234 1/10/2024
4.0.109 482 1/8/2024
4.0.108 242 1/6/2024
4.0.107 403 12/26/2023
4.0.106 206 12/26/2023
4.0.105 213 12/26/2023
4.0.104 243 12/25/2023
4.0.103 218 12/23/2023
4.0.102 224 12/21/2023
4.0.101 233 12/15/2023
4.0.100 222 12/14/2023
4.0.99 220 12/13/2023
4.0.98 229 12/13/2023
4.0.97 689 12/12/2023
4.0.96 216 12/12/2023
4.0.95 210 12/12/2023
4.0.94 216 12/11/2023
4.0.93 263 12/6/2023
4.0.92 203 12/6/2023
4.0.91 210 12/6/2023
4.0.90 188 12/4/2023
4.0.89 383 11/24/2023
4.0.88 213 11/24/2023
4.0.87 217 11/21/2023
4.0.86 215 11/20/2023
4.0.85 186 11/20/2023
4.0.84 263 11/17/2023
4.0.83 714 11/17/2023
4.0.82 214 11/15/2023
4.0.81 211 11/13/2023
4.0.80 248 11/9/2023
4.0.79 266 11/9/2023
4.0.78 181 11/8/2023
4.0.77 204 11/7/2023
4.0.76 217 11/6/2023
4.0.75 237 11/3/2023
4.0.74 262 11/2/2023
4.0.73 216 11/1/2023
4.0.72 243 10/31/2023
4.0.71 198 10/31/2023
4.0.70 198 10/30/2023
4.0.69 240 10/28/2023
4.0.68 235 10/26/2023
4.0.67 227 10/25/2023
4.0.66 226 10/17/2023
4.0.65 226 10/16/2023
4.0.64 195 10/16/2023
4.0.63 239 10/13/2023
4.0.62 248 10/12/2023
4.0.61 234 10/11/2023
4.0.60 270 10/5/2023
4.0.59 217 10/4/2023
4.0.58 254 9/26/2023
4.0.57 231 9/26/2023
4.0.56 240 9/22/2023
4.0.55 232 9/20/2023
4.0.54 237 9/19/2023
4.0.53 240 9/18/2023
4.0.52 214 9/18/2023
4.0.51 280 9/15/2023
4.0.50 244 9/14/2023
4.0.49 236 9/12/2023
4.0.48 310 9/12/2023
4.0.47 224 9/11/2023
4.0.46 258 9/11/2023
4.0.45 399 9/7/2023
4.0.44 265 9/6/2023
4.0.43 305 9/5/2023
4.0.42 265 9/4/2023
4.0.41 237 9/4/2023
4.0.40 295 9/1/2023
4.0.39 287 8/31/2023
4.0.38 287 8/31/2023
4.0.37 285 8/29/2023
4.0.36 253 8/29/2023
4.0.35 291 8/29/2023
4.0.34 307 8/25/2023
4.0.33 291 8/24/2023
4.0.32 292 8/23/2023
4.0.31 284 8/22/2023
4.0.30 283 8/18/2023
4.0.29 265 8/17/2023
4.0.28 308 8/17/2023
4.0.27 244 8/17/2023
4.0.26 385 8/10/2023
4.0.25 308 8/9/2023
4.0.24 314 8/8/2023
4.0.23 282 8/8/2023
4.0.22 267 8/8/2023
4.0.21 400 8/7/2023
4.0.20 297 8/4/2023
4.0.19 369 8/3/2023
4.0.18 300 8/2/2023
4.0.17 332 7/26/2023
4.0.16 338 7/25/2023
4.0.15 328 7/21/2023
4.0.14 304 7/19/2023
4.0.13 298 7/18/2023
4.0.12 267 7/18/2023
4.0.11 336 7/18/2023
4.0.10 258 7/18/2023
4.0.9 386 7/17/2023
4.0.8 289 7/17/2023
4.0.7 264 7/17/2023
4.0.6 276 7/17/2023
4.0.5 625 1/30/2023
4.0.4 391 1/30/2023
4.0.3 504 1/30/2023
4.0.2 505 1/27/2023
4.0.1 690 12/13/2022
4.0.0 430 12/12/2022
3.0.43 1,684 6/10/2022
3.0.41 1,093 4/20/2022
3.0.40 1,153 1/11/2022
3.0.39 921 1/10/2022
3.0.38 1,209 6/17/2021
3.0.37 903 6/16/2021
3.0.36 858 6/16/2021
3.0.35 632 6/16/2021
3.0.34 607 6/16/2021
3.0.33 1,130 1/7/2021
3.0.32 946 12/16/2020
3.0.31 883 12/14/2020
3.0.29 2,586 9/13/2020
3.0.28 1,051 6/19/2020
3.0.27 1,044 6/8/2020
3.0.26 1,803 5/12/2020
3.0.25 1,590 5/12/2020
3.0.24 1,048 4/28/2020
3.0.23 1,031 4/24/2020
3.0.22 1,033 4/16/2020
3.0.21 1,047 4/16/2020
3.0.20 750 4/15/2020
3.0.19 744 4/15/2020
3.0.18 1,292 4/14/2020
3.0.17 737 4/14/2020
3.0.16 1,095 4/10/2020
3.0.15 1,091 4/10/2020
3.0.14 3,256 3/26/2020
3.0.13 1,021 3/26/2020
3.0.12 767 3/25/2020
3.0.11 731 3/25/2020
3.0.10 736 3/25/2020
3.0.9 783 3/25/2020
3.0.8 774 3/25/2020
3.0.7 1,272 3/25/2020
3.0.6 1,465 3/21/2020
3.0.5 1,784 3/13/2020
3.0.4 792 3/13/2020
3.0.3 1,519 2/28/2020
3.0.2 1,316 2/21/2020
3.0.1 824 2/11/2020
3.0.0 2,015 12/23/2019
2.0.10 1,232 4/17/2019
2.0.9 1,766 2/21/2019
2.0.8 912 2/21/2019
2.0.7 4,305 8/1/2018
2.0.6 1,538 8/1/2018
2.0.5 1,863 6/26/2018
2.0.4 2,127 6/1/2018
2.0.3 2,076 5/22/2018
2.0.2 2,647 5/11/2018
2.0.1 2,686 2/13/2018
2.0.0 2,653 1/2/2018
1.0.10 14,714 6/16/2017
1.0.8 1,401 6/16/2017
1.0.7 1,374 5/30/2017
1.0.6 1,353 5/30/2017
1.0.5 1,357 5/25/2017
1.0.4 1,380 5/24/2017
1.0.0 1,410 5/24/2017