Holmes 5.0.93

There is a newer version of this package available.
See the version list below for details.
dotnet add package Holmes --version 5.0.93
                    
NuGet\Install-Package Holmes -Version 5.0.93
                    
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.93" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Holmes" Version="5.0.93" />
                    
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.93
                    
#r "nuget: Holmes, 5.0.93"
                    
#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.93
                    
#: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.93
                    
Install as a Cake Addin
#tool nuget:?package=Holmes&version=5.0.93
                    
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.95 480 11/18/2025
5.0.94 221 11/14/2025
5.0.93 188 11/14/2025
5.0.92 317 11/13/2025
5.0.91 300 11/13/2025
5.0.90 305 11/13/2025
5.0.89 241 11/6/2025
5.0.88 188 10/31/2025
5.0.87 271 10/17/2025
5.0.86 211 10/16/2025
5.0.85 205 10/15/2025
5.0.84 259 10/14/2025
5.0.83 211 10/13/2025
5.0.82 249 10/12/2025
5.0.81 280 9/30/2025
5.0.80 211 9/30/2025
5.0.79 168 9/30/2025
5.0.78 165 9/30/2025
5.0.77 257 9/25/2025
5.0.76 388 9/18/2025
5.0.75 359 9/17/2025
5.0.74 337 9/16/2025
5.0.73 216 9/11/2025
5.0.72 200 9/10/2025
5.0.71 207 9/9/2025
5.0.70 369 8/20/2025
5.0.69 177 8/20/2025
5.0.68 178 8/20/2025
5.0.67 177 8/19/2025
5.0.66 177 8/19/2025
5.0.65 176 8/19/2025
5.0.64 224 8/15/2025
5.0.63 345 8/6/2025
5.0.62 300 8/5/2025
5.0.61 262 8/5/2025
5.0.60 264 8/5/2025
5.0.59 280 8/5/2025
5.0.58 256 8/5/2025
5.0.57 233 8/1/2025
5.0.56 235 7/29/2025
5.0.55 146 7/29/2025
5.0.54 242 7/17/2025
5.0.53 227 7/16/2025
5.0.52 233 7/15/2025
5.0.51 187 7/15/2025
5.0.50 181 7/15/2025
5.0.49 212 7/8/2025
5.0.48 340 7/1/2025
5.0.47 188 7/1/2025
5.0.46 194 7/1/2025
5.0.45 230 6/28/2025
5.0.44 120 6/27/2025
5.0.43 252 6/27/2025
5.0.42 254 6/26/2025
5.0.41 225 6/18/2025
5.0.40 340 6/10/2025
5.0.39 137 5/30/2025
5.0.38 142 5/23/2025
5.0.37 285 5/14/2025
5.0.36 137 5/2/2025
5.0.35 226 4/29/2025
5.0.34 252 4/10/2025
5.0.33 222 3/17/2025
5.0.32 183 2/24/2025
5.0.31 203 2/13/2025
5.0.30 321 2/3/2025
5.0.29 221 1/30/2025
5.0.28 185 1/29/2025
5.0.27 182 1/29/2025
5.0.26 204 1/28/2025
5.0.25 201 1/24/2025
5.0.24 198 1/23/2025
5.0.23 208 1/22/2025
5.0.22 201 1/16/2025
5.0.21 179 1/15/2025
5.0.20 141 1/14/2025
5.0.19 145 1/13/2025
5.0.18 168 1/10/2025
5.0.17 156 1/9/2025
5.0.16 123 1/8/2025
5.0.15 251 12/17/2024
5.0.14 209 12/16/2024
5.0.13 214 12/10/2024
5.0.12 203 12/9/2024
5.0.11 215 12/6/2024
5.0.10 255 11/27/2024
5.0.9 171 11/26/2024
5.0.8 228 11/26/2024
5.0.7 226 11/24/2024
5.0.6 169 11/24/2024
5.0.5 169 11/23/2024
5.0.4 161 11/23/2024
4.0.270 192 11/19/2024
4.0.269 177 11/11/2024
4.0.268 169 11/7/2024
4.0.267 161 11/5/2024
4.0.266 165 11/4/2024
4.0.265 192 11/1/2024
4.0.264 166 11/1/2024
4.0.263 172 10/30/2024
4.0.262 176 10/29/2024
4.0.261 176 10/29/2024
4.0.260 178 10/26/2024
4.0.259 182 10/24/2024
4.0.258 185 10/21/2024
4.0.257 186 10/17/2024
4.0.256 171 10/15/2024
4.0.255 181 10/11/2024
4.0.254 170 10/10/2024
4.0.253 181 10/9/2024
4.0.252 198 10/9/2024
4.0.251 220 10/3/2024
4.0.250 195 10/2/2024
4.0.249 201 9/30/2024
4.0.248 195 9/28/2024
4.0.247 169 9/24/2024
4.0.246 184 9/23/2024
4.0.245 182 9/23/2024
4.0.244 214 9/17/2024
4.0.243 205 9/16/2024
4.0.242 200 9/10/2024
4.0.241 184 9/9/2024
4.0.240 184 9/6/2024
4.0.239 183 9/6/2024
4.0.238 195 9/3/2024
4.0.237 206 9/2/2024
4.0.236 187 8/30/2024
4.0.235 183 8/30/2024
4.0.234 194 8/28/2024
4.0.233 202 8/27/2024
4.0.232 180 8/26/2024
4.0.231 224 8/24/2024
4.0.230 203 8/23/2024
4.0.229 218 8/21/2024
4.0.228 215 8/21/2024
4.0.227 196 8/20/2024
4.0.226 198 8/19/2024
4.0.225 211 8/16/2024
4.0.224 208 8/16/2024
4.0.223 221 8/14/2024
4.0.222 211 8/5/2024
4.0.221 163 8/2/2024
4.0.220 169 8/1/2024
4.0.219 172 7/31/2024
4.0.218 194 7/26/2024
4.0.217 189 7/25/2024
4.0.216 166 7/25/2024
4.0.215 196 7/11/2024
4.0.214 210 7/10/2024
4.0.213 214 7/9/2024
4.0.212 184 7/9/2024
4.0.211 197 7/9/2024
4.0.210 180 7/5/2024
4.0.209 195 7/4/2024
4.0.208 214 7/3/2024
4.0.207 197 7/2/2024
4.0.206 205 6/27/2024
4.0.205 192 6/26/2024
4.0.204 196 6/25/2024
4.0.203 197 6/24/2024
4.0.202 1,317 6/19/2024
4.0.201 204 6/19/2024
4.0.200 198 6/17/2024
4.0.199 199 6/14/2024
4.0.198 188 6/14/2024
4.0.197 182 6/12/2024
4.0.196 203 6/3/2024
4.0.195 193 5/31/2024
4.0.194 169 5/30/2024
4.0.193 196 5/29/2024
4.0.192 185 5/28/2024
4.0.191 189 5/27/2024
4.0.190 189 5/23/2024
4.0.189 196 5/22/2024
4.0.188 201 5/21/2024
4.0.187 209 5/20/2024
4.0.186 207 5/18/2024
4.0.185 203 5/16/2024
4.0.184 201 5/15/2024
4.0.183 207 5/8/2024
4.0.182 218 5/7/2024
4.0.181 221 5/6/2024
4.0.180 197 5/3/2024
4.0.179 908 5/2/2024
4.0.178 182 5/2/2024
4.0.177 198 5/1/2024
4.0.176 207 4/29/2024
4.0.175 194 4/29/2024
4.0.174 210 4/25/2024
4.0.173 215 4/24/2024
4.0.172 211 4/16/2024
4.0.171 198 4/15/2024
4.0.170 218 4/13/2024
4.0.169 179 4/12/2024
4.0.168 200 4/11/2024
4.0.167 204 4/10/2024
4.0.166 192 4/9/2024
4.0.165 218 4/9/2024
4.0.164 200 4/1/2024
4.0.163 194 3/29/2024
4.0.162 210 3/29/2024
4.0.161 209 3/27/2024
4.0.160 192 3/22/2024
4.0.159 213 3/22/2024
4.0.158 222 3/18/2024
4.0.157 214 3/15/2024
4.0.156 205 3/14/2024
4.0.155 200 3/14/2024
4.0.154 200 3/11/2024
4.0.153 218 3/8/2024
4.0.152 209 3/7/2024
4.0.151 227 3/6/2024
4.0.150 244 3/5/2024
4.0.149 226 3/4/2024
4.0.148 1,343 3/2/2024
4.0.147 225 2/29/2024
4.0.146 196 2/29/2024
4.0.145 208 2/27/2024
4.0.144 195 2/26/2024
4.0.143 199 2/23/2024
4.0.142 210 2/22/2024
4.0.141 208 2/22/2024
4.0.140 203 2/21/2024
4.0.139 216 2/20/2024
4.0.138 214 2/19/2024
4.0.137 200 2/19/2024
4.0.136 211 2/16/2024
4.0.135 199 2/16/2024
4.0.134 209 2/15/2024
4.0.133 228 2/14/2024
4.0.132 197 2/14/2024
4.0.131 199 2/13/2024
4.0.130 232 2/9/2024
4.0.129 220 2/9/2024
4.0.128 198 2/7/2024
4.0.127 194 2/6/2024
4.0.126 208 2/6/2024
4.0.125 202 2/5/2024
4.0.124 203 2/3/2024
4.0.123 203 2/1/2024
4.0.122 191 2/1/2024
4.0.121 200 1/31/2024
4.0.120 206 1/29/2024
4.0.119 197 1/25/2024
4.0.118 200 1/24/2024
4.0.117 203 1/23/2024
4.0.116 211 1/22/2024
4.0.115 1,473 1/17/2024
4.0.114 177 1/16/2024
4.0.113 189 1/15/2024
4.0.112 192 1/12/2024
4.0.111 210 1/11/2024
4.0.110 217 1/10/2024
4.0.109 465 1/8/2024
4.0.108 226 1/6/2024
4.0.107 389 12/26/2023
4.0.106 192 12/26/2023
4.0.105 197 12/26/2023
4.0.104 229 12/25/2023
4.0.103 205 12/23/2023
4.0.102 210 12/21/2023
4.0.101 221 12/15/2023
4.0.100 205 12/14/2023
4.0.99 207 12/13/2023
4.0.98 213 12/13/2023
4.0.97 680 12/12/2023
4.0.96 203 12/12/2023
4.0.95 196 12/12/2023
4.0.94 199 12/11/2023
4.0.93 258 12/6/2023
4.0.92 192 12/6/2023
4.0.91 196 12/6/2023
4.0.90 183 12/4/2023
4.0.89 376 11/24/2023
4.0.88 207 11/24/2023
4.0.87 206 11/21/2023
4.0.86 206 11/20/2023
4.0.85 174 11/20/2023
4.0.84 253 11/17/2023
4.0.83 704 11/17/2023
4.0.82 206 11/15/2023
4.0.81 197 11/13/2023
4.0.80 237 11/9/2023
4.0.79 255 11/9/2023
4.0.78 169 11/8/2023
4.0.77 193 11/7/2023
4.0.76 203 11/6/2023
4.0.75 222 11/3/2023
4.0.74 250 11/2/2023
4.0.73 209 11/1/2023
4.0.72 232 10/31/2023
4.0.71 189 10/31/2023
4.0.70 191 10/30/2023
4.0.69 226 10/28/2023
4.0.68 227 10/26/2023
4.0.67 220 10/25/2023
4.0.66 217 10/17/2023
4.0.65 220 10/16/2023
4.0.64 183 10/16/2023
4.0.63 230 10/13/2023
4.0.62 240 10/12/2023
4.0.61 230 10/11/2023
4.0.60 262 10/5/2023
4.0.59 211 10/4/2023
4.0.58 244 9/26/2023
4.0.57 223 9/26/2023
4.0.56 229 9/22/2023
4.0.55 221 9/20/2023
4.0.54 225 9/19/2023
4.0.53 231 9/18/2023
4.0.52 204 9/18/2023
4.0.51 273 9/15/2023
4.0.50 234 9/14/2023
4.0.49 224 9/12/2023
4.0.48 303 9/12/2023
4.0.47 218 9/11/2023
4.0.46 245 9/11/2023
4.0.45 390 9/7/2023
4.0.44 255 9/6/2023
4.0.43 297 9/5/2023
4.0.42 258 9/4/2023
4.0.41 230 9/4/2023
4.0.40 283 9/1/2023
4.0.39 277 8/31/2023
4.0.38 281 8/31/2023
4.0.37 279 8/29/2023
4.0.36 246 8/29/2023
4.0.35 284 8/29/2023
4.0.34 294 8/25/2023
4.0.33 279 8/24/2023
4.0.32 280 8/23/2023
4.0.31 276 8/22/2023
4.0.30 276 8/18/2023
4.0.29 255 8/17/2023
4.0.28 300 8/17/2023
4.0.27 232 8/17/2023
4.0.26 376 8/10/2023
4.0.25 293 8/9/2023
4.0.24 300 8/8/2023
4.0.23 270 8/8/2023
4.0.22 252 8/8/2023
4.0.21 389 8/7/2023
4.0.20 284 8/4/2023
4.0.19 358 8/3/2023
4.0.18 291 8/2/2023
4.0.17 318 7/26/2023
4.0.16 325 7/25/2023
4.0.15 315 7/21/2023
4.0.14 293 7/19/2023
4.0.13 283 7/18/2023
4.0.12 257 7/18/2023
4.0.11 322 7/18/2023
4.0.10 245 7/18/2023
4.0.9 374 7/17/2023
4.0.8 275 7/17/2023
4.0.7 252 7/17/2023
4.0.6 269 7/17/2023
4.0.5 605 1/30/2023
4.0.4 378 1/30/2023
4.0.3 486 1/30/2023
4.0.2 486 1/27/2023
4.0.1 671 12/13/2022
4.0.0 418 12/12/2022
3.0.43 1,670 6/10/2022
3.0.41 1,072 4/20/2022
3.0.40 1,137 1/11/2022
3.0.39 903 1/10/2022
3.0.38 1,191 6/17/2021
3.0.37 883 6/16/2021
3.0.36 840 6/16/2021
3.0.35 617 6/16/2021
3.0.34 585 6/16/2021
3.0.33 1,107 1/7/2021
3.0.32 924 12/16/2020
3.0.31 861 12/14/2020
3.0.29 2,564 9/13/2020
3.0.28 1,030 6/19/2020
3.0.27 1,023 6/8/2020
3.0.26 1,786 5/12/2020
3.0.25 1,569 5/12/2020
3.0.24 1,026 4/28/2020
3.0.23 1,010 4/24/2020
3.0.22 1,016 4/16/2020
3.0.21 1,023 4/16/2020
3.0.20 730 4/15/2020
3.0.19 722 4/15/2020
3.0.18 1,274 4/14/2020
3.0.17 713 4/14/2020
3.0.16 1,076 4/10/2020
3.0.15 1,071 4/10/2020
3.0.14 3,233 3/26/2020
3.0.13 998 3/26/2020
3.0.12 744 3/25/2020
3.0.11 712 3/25/2020
3.0.10 717 3/25/2020
3.0.9 758 3/25/2020
3.0.8 751 3/25/2020
3.0.7 1,249 3/25/2020
3.0.6 1,437 3/21/2020
3.0.5 1,768 3/13/2020
3.0.4 768 3/13/2020
3.0.3 1,500 2/28/2020
3.0.2 1,296 2/21/2020
3.0.1 800 2/11/2020
3.0.0 1,994 12/23/2019
2.0.10 1,212 4/17/2019
2.0.9 1,742 2/21/2019
2.0.8 894 2/21/2019
2.0.7 4,272 8/1/2018
2.0.6 1,504 8/1/2018
2.0.5 1,835 6/26/2018
2.0.4 2,081 6/1/2018
2.0.3 2,033 5/22/2018
2.0.2 2,602 5/11/2018
2.0.1 2,646 2/13/2018
2.0.0 2,610 1/2/2018
1.0.10 14,674 6/16/2017
1.0.8 1,372 6/16/2017
1.0.7 1,339 5/30/2017
1.0.6 1,322 5/30/2017
1.0.5 1,325 5/25/2017
1.0.4 1,346 5/24/2017
1.0.0 1,380 5/24/2017