diff --git a/MiniProfiler.nuspec b/MiniProfiler.nuspec index 59dcb9247..35891c88a 100644 --- a/MiniProfiler.nuspec +++ b/MiniProfiler.nuspec @@ -2,7 +2,7 @@ MiniProfiler - 3.0.11 + 3.0.12 Marc Gravell, Jarrod Dixon, Yaakov Ellis, Nick Craver Marc Gravell, Jarrod Dixon, Yaakov Ellis, Nick Craver Lightweight mini-profiler, in particular designed for ASP.NET MVC sites @@ -10,7 +10,7 @@ http://www.apache.org/licenses/LICENSE-2.0 profiler sql mvc asp.net performance profiling timing en-US - See https://github.com/MiniProfiler/dotnet/releases for more info + Restores API signature for ISqlFormatter (see issue #68). VerboseSql and enhanced stored procedures pushed to v3.1. See https://github.com/MiniProfiler/dotnet/releases for more info diff --git a/StackExchange.Profiling.Tests/SqlFormatterTest.cs b/StackExchange.Profiling.Tests/SqlFormatterTest.cs index 8e5ae7a3d..1271428e2 100644 --- a/StackExchange.Profiling.Tests/SqlFormatterTest.cs +++ b/StackExchange.Profiling.Tests/SqlFormatterTest.cs @@ -39,7 +39,7 @@ private void CreateDbCommand(CommandType commandType) private string GenerateOutput() { var sqlParameters = SqlTiming.GetCommandParameters(_dbCommand); - var output = _formatter.FormatSql(_commandText, sqlParameters, _dbCommand); + var output = _formatter.FormatSql(_commandText, sqlParameters); return output; } @@ -99,6 +99,8 @@ private static DbType GetDbType(Type type) return _dbTypeMap[type.TypeHandle]; } + // Code being removed for v3.0.x to maintain semver versioning. Will be present in v3.1+ + /* [Test] public void EnsureVerboseSqlServerFormatterOnlyAddsInformation() { @@ -114,7 +116,7 @@ public void EnsureVerboseSqlServerFormatterOnlyAddsInformation() // assert Assert.AreEqual(expectedOutput, actualOutput); - } + }*/ [Test] public void TabelQueryWithoutParameters() diff --git a/StackExchange.Profiling/SqlFormatters/ISqlFormatter.cs b/StackExchange.Profiling/SqlFormatters/ISqlFormatter.cs index 9e4dc185c..563d25271 100644 --- a/StackExchange.Profiling/SqlFormatters/ISqlFormatter.cs +++ b/StackExchange.Profiling/SqlFormatters/ISqlFormatter.cs @@ -11,6 +11,6 @@ public interface ISqlFormatter /// /// Return SQL the way you want it to look on the in the trace. Usually used to format parameters. /// - string FormatSql(string commandText, List parameters, IDbCommand command = null); + string FormatSql(string commandText, List parameters); } } diff --git a/StackExchange.Profiling/SqlFormatters/InlineFormatter.cs b/StackExchange.Profiling/SqlFormatters/InlineFormatter.cs index a5e08c83b..0999ab784 100644 --- a/StackExchange.Profiling/SqlFormatters/InlineFormatter.cs +++ b/StackExchange.Profiling/SqlFormatters/InlineFormatter.cs @@ -28,7 +28,7 @@ public InlineFormatter(bool includeTypeInfo = false) /// Formats the SQL in a generic friendly format, including the parameter type information /// in a comment if it was specified in the InlineFormatter constructor /// - public string FormatSql(string commandText, List parameters, IDbCommand command = null) + public string FormatSql(string commandText, List parameters) { if (parameters == null || parameters.Count == 0) { diff --git a/StackExchange.Profiling/SqlFormatters/SqlServerFormatter.cs b/StackExchange.Profiling/SqlFormatters/SqlServerFormatter.cs index 39165aaf6..301076060 100644 --- a/StackExchange.Profiling/SqlFormatters/SqlServerFormatter.cs +++ b/StackExchange.Profiling/SqlFormatters/SqlServerFormatter.cs @@ -59,7 +59,7 @@ static SqlServerFormatter() /// /// Formats the SQL in a SQL-Server friendly way, with DECLARE statements for the parameters up top. /// - public virtual string FormatSql(string commandText, List parameters, IDbCommand command = null) + public virtual string FormatSql(string commandText, List parameters) { StringBuilder buffer = new StringBuilder(); @@ -72,15 +72,18 @@ public virtual string FormatSql(string commandText, List par .AppendLine(); } + // Code being removed for v3.0.x to maintain semver versioning. Will be present in v3.1+ + // only treat 'StoredProcedure' differently since 'Text' may contain 'TableDirect' or 'StoredProcedure' - if (command != null && command.CommandType == CommandType.StoredProcedure) + /*if (command != null && command.CommandType == CommandType.StoredProcedure) { GenerateStoreProcedureCall(commandText, parameters, buffer); } else { buffer.Append(commandText); - } + }*/ + buffer.Append(commandText); string formattedText = TerminateSqlStatement(buffer.ToString()); return formattedText; diff --git a/StackExchange.Profiling/SqlFormatters/VerboseSqlServerFormatter.cs b/StackExchange.Profiling/SqlFormatters/VerboseSqlServerFormatter.cs index e4289f3f5..4858519a6 100644 --- a/StackExchange.Profiling/SqlFormatters/VerboseSqlServerFormatter.cs +++ b/StackExchange.Profiling/SqlFormatters/VerboseSqlServerFormatter.cs @@ -4,9 +4,12 @@ namespace StackExchange.Profiling.SqlFormatters { - /// + // Code being removed for v3.0.x to maintain semver versioning. Will be present in v3.1+ + + /*/// /// Formats SQL server queries with a DECLARE up top for parameter values /// + /// public class VerboseSqlServerFormatter : SqlServerFormatter { /// @@ -33,5 +36,5 @@ public override string FormatSql(string commandText, List pa return buffer.ToString(); } - } + }*/ } diff --git a/StackExchange.Profiling/SqlTiming.cs b/StackExchange.Profiling/SqlTiming.cs index 4c64c4df4..a17c576f4 100644 --- a/StackExchange.Profiling/SqlTiming.cs +++ b/StackExchange.Profiling/SqlTiming.cs @@ -35,7 +35,7 @@ public SqlTiming(IDbCommand command, SqlExecuteType type, MiniProfiler profiler) if (MiniProfiler.Settings.SqlFormatter != null) { - commandText = MiniProfiler.Settings.SqlFormatter.FormatSql(commandText, parameters, command); + commandText = MiniProfiler.Settings.SqlFormatter.FormatSql(commandText, parameters); } _customTiming = profiler.CustomTiming("sql", commandText, type.ToString());