From 793a94121c2352f65fcab36f536b6299db8ac932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Fri, 26 Jul 2024 18:34:46 +0200 Subject: [PATCH 1/2] Removing unused BatchCommand.DefaultBuilderCapacity --- src/YesSql.Core/Commands/BatchCommand.cs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/YesSql.Core/Commands/BatchCommand.cs b/src/YesSql.Core/Commands/BatchCommand.cs index 53eec3db..890994c5 100644 --- a/src/YesSql.Core/Commands/BatchCommand.cs +++ b/src/YesSql.Core/Commands/BatchCommand.cs @@ -9,8 +9,6 @@ namespace YesSql.Commands { public class BatchCommand : IIndexCommand { - public static int DefaultBuilderCapacity = 10 * 1024; - public List Queries { get; set; } = new List(); public DbCommand Command { get; set; } public List> Actions = new(); @@ -54,14 +52,6 @@ public async Task ExecuteAsync(DbConnection connection, DbTransaction transactio logger.LogTrace(command); } - if (command.Length > DefaultBuilderCapacity) - { - if (logger.IsEnabled(LogLevel.Warning)) - { - logger.LogWarning("The default capacity of the BatchCommand StringBuilder {Default} might not be sufficient. It can be increased with BatchCommand.DefaultBuilderCapacity to at least {Suggested}", DefaultBuilderCapacity, command.Length); - } - } - Command.Transaction = transaction; Command.CommandText = command; From bc52cb5e71c93ae09748272bdc0a600a195e36c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 20 Aug 2024 20:53:23 +0200 Subject: [PATCH 2/2] Obsoleting DefaultBuilderCapacity instead of removing it --- src/YesSql.Core/Commands/BatchCommand.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/YesSql.Core/Commands/BatchCommand.cs b/src/YesSql.Core/Commands/BatchCommand.cs index 890994c5..0a5b23a9 100644 --- a/src/YesSql.Core/Commands/BatchCommand.cs +++ b/src/YesSql.Core/Commands/BatchCommand.cs @@ -9,6 +9,9 @@ namespace YesSql.Commands { public class BatchCommand : IIndexCommand { + [Obsolete("The field is not used anymore since the current batching implementation doesn't need it.")] + public static int DefaultBuilderCapacity = 10 * 1024; + public List Queries { get; set; } = new List(); public DbCommand Command { get; set; } public List> Actions = new();