Loquacious

View project on GitHub

Loquacious Data Provider

This very loquacious data provider is the easiest way for your Sitecore solution to show the SQL Queries your fast queries translate to and measure them at the same time.

It is meant as a development helper tool, and although it doesn't change the behavior of your database queries, it should not be used in production environments.

How it works

An include-file replaces the main data provider with the loquacious implementation and adds additional log output about the original fast query, the SQL query generated by Sitecore and the measured time executing the SQL query against the database.

DEBUG FastQuery: //*[@@id='{4767FE06-CCE5-420A-91F9-4B0D3918069C}']/#*#/#Demo#[@@templateid='{FBED2389-6637-4934-BE28-F5C2B9374FEB}']
DEBUG SQL Query: SELECT DISTINCT [i].[ID] [ID], [i].[ParentID] [ParentID] FROM [Items] [i] INNER JOIN (SELECT DISTINCT [i].[ID] [ID], [i].[ParentID] [ParentID] FROM [Items] [i] INNER JOIN (SELECT DISTINCT [i].[ID] [ID], [i].[ParentID] [ParentID] FROM [Items] [i] WHERE ([i].[ID] = '{4767FE06-CCE5-420A-91F9-4B0D3918069C}')) [a] ON [i].[ParentID] = [a].[ID] WHERE LOWER([i].[Name]) = 'cug') [a] ON [i].[ParentID] = [a].[ID] WHERE ([i].[TemplateID] = '{FBED2389-6637-4934-BE28-F5C2B9374FEB}') AND LOWER([i].[Name]) = 'demo'
DEBUG Query Time: 17ms

Filters

You can add any string as a filter to the config file to reduce the output of the data provider. If you define no filters, every fast query will get logged.

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" >
  <sitecore>
    <dataProviders>
      <main  type="Loquacious.DataProvider.LoquaciousDataProvider, Loquacious.DataProvider" patch:instead="main">
        <param connectionStringName="$(1)" />
        <Name>$(1)</Name>
        <!--
        <filters hint="list">
          <filter>{E248FD78-B482-49FD-9151-F0A926448576}</filter>
        </filters>
        -->
      </main>
    </dataProviders>
  </sitecore>
</configuration>

Download

You can either clone the repository from GitHub or download the NuGet package from the NuGet Gallery.

Installation

Nuget

The easiest way to install the data provider is by installing the NuGet package. As it is not a Sitecore NuGet package, you don't need a Sitecore Rocks connection. There is no additional configuration. After installing the Nuget package you're all set.

Manual installation

You can manually install the data provider by copying the Loqacious.DataProvider.dll to you bin folder and adding the config-file to your include folder.

Version

The loquacious data provider has been developed with Visual Studio 2013 and Sitecore 6.6. The nuget package contains a version for .NET 4 compiled against Sitecore 6.6 and a version for .NET 4.5 compiled against Sitecore 7. You should be able to work with other versions as well. If you have some problems with any versions, please let me know by adding an issue.

License

See the LICENSE file for license rights and limitations (GNU GENERAL PUBLIC LICENSE v2).

Credits

Credits go to any decompiler in the world.