Holmes 5.0.49

dotnet add package Holmes --version 5.0.49
                    
NuGet\Install-Package Holmes -Version 5.0.49
                    
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.49" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Holmes" Version="5.0.49" />
                    
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.49
                    
#r "nuget: Holmes, 5.0.49"
                    
#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.
#addin nuget:?package=Holmes&version=5.0.49
                    
Install as a Cake Addin
#tool nuget:?package=Holmes&version=5.0.49
                    
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.49 139 7/8/2025
5.0.48 230 7/1/2025
5.0.47 126 7/1/2025
5.0.46 131 7/1/2025
5.0.45 136 6/28/2025
5.0.44 59 6/27/2025
5.0.43 176 6/27/2025
5.0.42 171 6/26/2025
5.0.41 139 6/18/2025
5.0.40 279 6/10/2025
5.0.39 73 5/30/2025
5.0.38 83 5/23/2025
5.0.37 227 5/14/2025
5.0.36 80 5/2/2025
5.0.35 166 4/29/2025
5.0.34 191 4/10/2025
5.0.33 165 3/17/2025
5.0.32 123 2/24/2025
5.0.31 147 2/13/2025
5.0.30 256 2/3/2025
5.0.29 160 1/30/2025
5.0.28 121 1/29/2025
5.0.27 130 1/29/2025
5.0.26 141 1/28/2025
5.0.25 132 1/24/2025
5.0.24 127 1/23/2025
5.0.23 134 1/22/2025
5.0.22 135 1/16/2025
5.0.21 125 1/15/2025
5.0.20 73 1/14/2025
5.0.19 88 1/13/2025
5.0.18 108 1/10/2025
5.0.17 92 1/9/2025
5.0.16 72 1/8/2025
5.0.15 197 12/17/2024
5.0.14 145 12/16/2024
5.0.13 149 12/10/2024
5.0.12 134 12/9/2024
5.0.11 141 12/6/2024
5.0.10 187 11/27/2024
5.0.9 124 11/26/2024
5.0.8 157 11/26/2024
5.0.7 153 11/24/2024
5.0.6 123 11/24/2024
5.0.5 117 11/23/2024
5.0.4 119 11/23/2024
4.0.270 140 11/19/2024
4.0.269 129 11/11/2024
4.0.268 115 11/7/2024
4.0.267 119 11/5/2024
4.0.266 114 11/4/2024
4.0.265 130 11/1/2024
4.0.264 116 11/1/2024
4.0.263 119 10/30/2024
4.0.262 127 10/29/2024
4.0.261 121 10/29/2024
4.0.260 124 10/26/2024
4.0.259 129 10/24/2024
4.0.258 132 10/21/2024
4.0.257 137 10/17/2024
4.0.256 126 10/15/2024
4.0.255 128 10/11/2024
4.0.254 124 10/10/2024
4.0.253 120 10/9/2024
4.0.252 132 10/9/2024
4.0.251 171 10/3/2024
4.0.250 143 10/2/2024
4.0.249 145 9/30/2024
4.0.248 135 9/28/2024
4.0.247 123 9/24/2024
4.0.246 128 9/23/2024
4.0.245 125 9/23/2024
4.0.244 170 9/17/2024
4.0.243 151 9/16/2024
4.0.242 146 9/10/2024
4.0.241 131 9/9/2024
4.0.240 135 9/6/2024
4.0.239 131 9/6/2024
4.0.238 141 9/3/2024
4.0.237 148 9/2/2024
4.0.236 133 8/30/2024
4.0.235 139 8/30/2024
4.0.234 142 8/28/2024
4.0.233 148 8/27/2024
4.0.232 137 8/26/2024
4.0.231 165 8/24/2024
4.0.230 160 8/23/2024
4.0.229 168 8/21/2024
4.0.228 162 8/21/2024
4.0.227 154 8/20/2024
4.0.226 149 8/19/2024
4.0.225 161 8/16/2024
4.0.224 154 8/16/2024
4.0.223 161 8/14/2024
4.0.222 154 8/5/2024
4.0.221 107 8/2/2024
4.0.220 110 8/1/2024
4.0.219 119 7/31/2024
4.0.218 137 7/26/2024
4.0.217 132 7/25/2024
4.0.216 112 7/25/2024
4.0.215 142 7/11/2024
4.0.214 155 7/10/2024
4.0.213 161 7/9/2024
4.0.212 129 7/9/2024
4.0.211 144 7/9/2024
4.0.210 139 7/5/2024
4.0.209 140 7/4/2024
4.0.208 164 7/3/2024
4.0.207 140 7/2/2024
4.0.206 148 6/27/2024
4.0.205 144 6/26/2024
4.0.204 145 6/25/2024
4.0.203 139 6/24/2024
4.0.202 1,013 6/19/2024
4.0.201 151 6/19/2024
4.0.200 148 6/17/2024
4.0.199 148 6/14/2024
4.0.198 138 6/14/2024
4.0.197 125 6/12/2024
4.0.196 148 6/3/2024
4.0.195 140 5/31/2024
4.0.194 123 5/30/2024
4.0.193 144 5/29/2024
4.0.192 131 5/28/2024
4.0.191 138 5/27/2024
4.0.190 145 5/23/2024
4.0.189 144 5/22/2024
4.0.188 151 5/21/2024
4.0.187 159 5/20/2024
4.0.186 153 5/18/2024
4.0.185 149 5/16/2024
4.0.184 148 5/15/2024
4.0.183 148 5/8/2024
4.0.182 165 5/7/2024
4.0.181 166 5/6/2024
4.0.180 142 5/3/2024
4.0.179 675 5/2/2024
4.0.178 126 5/2/2024
4.0.177 147 5/1/2024
4.0.176 155 4/29/2024
4.0.175 140 4/29/2024
4.0.174 148 4/25/2024
4.0.173 162 4/24/2024
4.0.172 154 4/16/2024
4.0.171 149 4/15/2024
4.0.170 165 4/13/2024
4.0.169 141 4/12/2024
4.0.168 157 4/11/2024
4.0.167 155 4/10/2024
4.0.166 144 4/9/2024
4.0.165 163 4/9/2024
4.0.164 149 4/1/2024
4.0.163 147 3/29/2024
4.0.162 151 3/29/2024
4.0.161 157 3/27/2024
4.0.160 146 3/22/2024
4.0.159 155 3/22/2024
4.0.158 167 3/18/2024
4.0.157 160 3/15/2024
4.0.156 148 3/14/2024
4.0.155 158 3/14/2024
4.0.154 159 3/11/2024
4.0.153 163 3/8/2024
4.0.152 156 3/7/2024
4.0.151 168 3/6/2024
4.0.150 179 3/5/2024
4.0.149 179 3/4/2024
4.0.148 999 3/2/2024
4.0.147 169 2/29/2024
4.0.146 143 2/29/2024
4.0.145 155 2/27/2024
4.0.144 146 2/26/2024
4.0.143 151 2/23/2024
4.0.142 160 2/22/2024
4.0.141 160 2/22/2024
4.0.140 159 2/21/2024
4.0.139 163 2/20/2024
4.0.138 152 2/19/2024
4.0.137 158 2/19/2024
4.0.136 155 2/16/2024
4.0.135 151 2/16/2024
4.0.134 157 2/15/2024
4.0.133 176 2/14/2024
4.0.132 155 2/14/2024
4.0.131 158 2/13/2024
4.0.130 177 2/9/2024
4.0.129 168 2/9/2024
4.0.128 159 2/7/2024
4.0.127 145 2/6/2024
4.0.126 154 2/6/2024
4.0.125 151 2/5/2024
4.0.124 151 2/3/2024
4.0.123 161 2/1/2024
4.0.122 136 2/1/2024
4.0.121 149 1/31/2024
4.0.120 155 1/29/2024
4.0.119 144 1/25/2024
4.0.118 146 1/24/2024
4.0.117 152 1/23/2024
4.0.116 156 1/22/2024
4.0.115 1,060 1/17/2024
4.0.114 148 1/16/2024
4.0.113 148 1/15/2024
4.0.112 151 1/12/2024
4.0.111 159 1/11/2024
4.0.110 162 1/10/2024
4.0.109 347 1/8/2024
4.0.108 173 1/6/2024
4.0.107 308 12/26/2023
4.0.106 141 12/26/2023
4.0.105 147 12/26/2023
4.0.104 179 12/25/2023
4.0.103 156 12/23/2023
4.0.102 161 12/21/2023
4.0.101 171 12/15/2023
4.0.100 156 12/14/2023
4.0.99 158 12/13/2023
4.0.98 164 12/13/2023
4.0.97 506 12/12/2023
4.0.96 153 12/12/2023
4.0.95 146 12/12/2023
4.0.94 148 12/11/2023
4.0.93 222 12/6/2023
4.0.92 162 12/6/2023
4.0.91 163 12/6/2023
4.0.90 148 12/4/2023
4.0.89 296 11/24/2023
4.0.88 162 11/24/2023
4.0.87 159 11/21/2023
4.0.86 158 11/20/2023
4.0.85 139 11/20/2023
4.0.84 193 11/17/2023
4.0.83 663 11/17/2023
4.0.82 175 11/15/2023
4.0.81 159 11/13/2023
4.0.80 185 11/9/2023
4.0.79 200 11/9/2023
4.0.78 146 11/8/2023
4.0.77 157 11/7/2023
4.0.76 166 11/6/2023
4.0.75 170 11/3/2023
4.0.74 200 11/2/2023
4.0.73 172 11/1/2023
4.0.72 177 10/31/2023
4.0.71 154 10/31/2023
4.0.70 147 10/30/2023
4.0.69 183 10/28/2023
4.0.68 172 10/26/2023
4.0.67 178 10/25/2023
4.0.66 175 10/17/2023
4.0.65 165 10/16/2023
4.0.64 147 10/16/2023
4.0.63 192 10/13/2023
4.0.62 191 10/12/2023
4.0.61 180 10/11/2023
4.0.60 210 10/5/2023
4.0.59 181 10/4/2023
4.0.58 193 9/26/2023
4.0.57 178 9/26/2023
4.0.56 182 9/22/2023
4.0.55 187 9/20/2023
4.0.54 196 9/19/2023
4.0.53 186 9/18/2023
4.0.52 163 9/18/2023
4.0.51 227 9/15/2023
4.0.50 183 9/14/2023
4.0.49 185 9/12/2023
4.0.48 254 9/12/2023
4.0.47 173 9/11/2023
4.0.46 206 9/11/2023
4.0.45 314 9/7/2023
4.0.44 207 9/6/2023
4.0.43 239 9/5/2023
4.0.42 203 9/4/2023
4.0.41 185 9/4/2023
4.0.40 224 9/1/2023
4.0.39 227 8/31/2023
4.0.38 217 8/31/2023
4.0.37 222 8/29/2023
4.0.36 200 8/29/2023
4.0.35 229 8/29/2023
4.0.34 233 8/25/2023
4.0.33 219 8/24/2023
4.0.32 221 8/23/2023
4.0.31 228 8/22/2023
4.0.30 218 8/18/2023
4.0.29 206 8/17/2023
4.0.28 235 8/17/2023
4.0.27 186 8/17/2023
4.0.26 306 8/10/2023
4.0.25 233 8/9/2023
4.0.24 242 8/8/2023
4.0.23 216 8/8/2023
4.0.22 202 8/8/2023
4.0.21 327 8/7/2023
4.0.20 230 8/4/2023
4.0.19 286 8/3/2023
4.0.18 233 8/2/2023
4.0.17 264 7/26/2023
4.0.16 257 7/25/2023
4.0.15 267 7/21/2023
4.0.14 225 7/19/2023
4.0.13 227 7/18/2023
4.0.12 205 7/18/2023
4.0.11 255 7/18/2023
4.0.10 202 7/18/2023
4.0.9 305 7/17/2023
4.0.8 224 7/17/2023
4.0.7 204 7/17/2023
4.0.6 213 7/17/2023
4.0.5 528 1/30/2023
4.0.4 314 1/30/2023
4.0.3 414 1/30/2023
4.0.2 417 1/27/2023
4.0.1 595 12/13/2022
4.0.0 353 12/12/2022
3.0.43 1,555 6/10/2022
3.0.41 992 4/20/2022
3.0.40 1,032 1/11/2022
3.0.39 817 1/10/2022
3.0.38 1,095 6/17/2021
3.0.37 807 6/16/2021
3.0.36 753 6/16/2021
3.0.35 539 6/16/2021
3.0.34 516 6/16/2021
3.0.33 995 1/7/2021
3.0.32 825 12/16/2020
3.0.31 770 12/14/2020
3.0.29 2,362 9/13/2020
3.0.28 914 6/19/2020
3.0.27 919 6/8/2020
3.0.26 1,676 5/12/2020
3.0.25 1,441 5/12/2020
3.0.24 917 4/28/2020
3.0.23 920 4/24/2020
3.0.22 921 4/16/2020
3.0.21 926 4/16/2020
3.0.20 652 4/15/2020
3.0.19 635 4/15/2020
3.0.18 1,182 4/14/2020
3.0.17 635 4/14/2020
3.0.16 971 4/10/2020
3.0.15 998 4/10/2020
3.0.14 3,093 3/26/2020
3.0.13 913 3/26/2020
3.0.12 658 3/25/2020
3.0.11 639 3/25/2020
3.0.10 632 3/25/2020
3.0.9 672 3/25/2020
3.0.8 665 3/25/2020
3.0.7 1,153 3/25/2020
3.0.6 1,327 3/21/2020
3.0.5 1,664 3/13/2020
3.0.4 696 3/13/2020
3.0.3 1,390 2/28/2020
3.0.2 1,209 2/21/2020
3.0.1 717 2/11/2020
3.0.0 1,886 12/23/2019
2.0.10 1,120 4/17/2019
2.0.9 1,640 2/21/2019
2.0.8 818 2/21/2019
2.0.7 4,014 8/1/2018
2.0.6 1,375 8/1/2018
2.0.5 1,685 6/26/2018
2.0.4 1,857 6/1/2018
2.0.3 1,816 5/22/2018
2.0.2 2,377 5/11/2018
2.0.1 2,449 2/13/2018
2.0.0 2,363 1/2/2018
1.0.10 14,110 6/16/2017
1.0.8 1,233 6/16/2017
1.0.7 1,198 5/30/2017
1.0.6 1,171 5/30/2017
1.0.5 1,182 5/25/2017
1.0.4 1,205 5/24/2017
1.0.0 1,235 5/24/2017