diff --git a/Source/Core/ChunkSizing.cs b/Source/Core/ChunkSizing.cs
index ead23bb5..7167dec5 100644
--- a/Source/Core/ChunkSizing.cs
+++ b/Source/Core/ChunkSizing.cs
@@ -52,7 +52,7 @@ internal sealed class ChunkSizes
/// most 2^20. The default is 16.
///
///
- /// The doublings per chunk of the chain: 1 to 4. The default is 1.
+ /// The bit shift per chunk of the chain (1 doubles, 2 quadruples), 1 to 4. The default is 1.
///
///
/// The rows in the largest chunk of the chain: a power of two, at most 2^26.
@@ -101,7 +101,7 @@ public ChunkSizes(
/// Gets the number of rows in the first chunk of the collecting chain.
public int CollectFirstRows { get; }
- /// Gets the number of doublings per chunk of the chain.
+ /// Gets the bit shift per chunk of the chain (1 doubles, 2 quadruples).
public int CollectShift { get; }
/// Gets the number of rows in the largest chunk of the chain.
diff --git a/Source/Core/Core/CancellationTokens.cs b/Source/Core/Core/CancellationTokens.cs
index dec1e737..e2463198 100644
--- a/Source/Core/Core/CancellationTokens.cs
+++ b/Source/Core/Core/CancellationTokens.cs
@@ -63,7 +63,7 @@ public static ValueTask RunAsync(
commandToken,
callToken,
out CancellationTokenSource? linked);
- // When no linked source is needed there is no state machine and no allocation; a static lambda with a state keeps it that way for a call with at most one token.
+ // When no linked source is needed there is no state machine and no allocation.
return linked is null
? start(state, token)
: Linked(linked, token, state, start);
@@ -78,35 +78,4 @@ static async ValueTask Linked(
return await start(state, token).ConfigureAwait(false);
}
}
-
- ///
- /// The type of the state.
- /// A task that represents the call.
- [SuppressMessage(
- "Design", "CA1068:CancellationToken parameters must come last")]
- public static ValueTask RunAsync(
- CancellationToken commandToken,
- CancellationToken callToken,
- TState state,
- Func start)
- {
- CancellationToken token = Combine(
- commandToken,
- callToken,
- out CancellationTokenSource? linked);
- return linked is null
- ? start(state, token)
- : Linked(linked, token, state, start);
-
- static async ValueTask Linked(
- CancellationTokenSource linked,
- CancellationToken token,
- TState state,
- Func start)
- {
- using (linked)
- await start(state, token).ConfigureAwait(false);
- }
- }
}
diff --git a/Source/Core/Core/RowReader.cs b/Source/Core/Core/RowReader.cs
index 529cc37e..909478ca 100644
--- a/Source/Core/Core/RowReader.cs
+++ b/Source/Core/Core/RowReader.cs
@@ -846,13 +846,6 @@ static ValueTask ReadRowAsync(DbDataReader reader, bool useReadAsync, Canc
#endregion
}
-internal readonly struct ListSink(List list) : IRowSink
-{
- public List List { get; } = list;
- public void Add(T item) => List.Add(item);
- public int Count => List.Count;
-}
-
///
/// Makes the result of a collecting terminal from the rows in a chain.
///
diff --git a/Source/Core/DbQueryBinding.cs b/Source/Core/DbQueryBinding.cs
index 7b27cb6f..6ecf1c79 100644
--- a/Source/Core/DbQueryBinding.cs
+++ b/Source/Core/DbQueryBinding.cs
@@ -68,17 +68,6 @@ public static string ResolveDerived(
return last.Real;
}
- ///
- /// Gets the names of the members of an object.
- ///
- /// The type of the object.
- /// The object.
- /// The names of the members.
- public static string[] MemberNames(T value)
- => typeof(T) == typeof(object)
- ? RuntimeParamSource.Of(value!.GetType()).Names
- : ParamSource.Names;
-
///
/// Adds a parameter of a written or derived name.
///
@@ -308,7 +297,7 @@ static bool Has(DbCommand command, string name)
public static bool SameName(string a, string b)
=> Bare(a).Equals(Bare(b), StringComparison.OrdinalIgnoreCase);
- static ReadOnlySpan Bare(string name)
+ internal static ReadOnlySpan Bare(string name)
=> name.Length > 0 && name[0] == '@'
? name.AsSpan(1)
: name.AsSpan();
diff --git a/Source/Core/ExpressiveCommandBase.cs b/Source/Core/ExpressiveCommandBase.cs
index 7508e53e..70d88d61 100644
--- a/Source/Core/ExpressiveCommandBase.cs
+++ b/Source/Core/ExpressiveCommandBase.cs
@@ -1050,7 +1050,7 @@ void Apply(
// A member of an object that the procedure does not take is simply not sent; an argument named by the caller must match.
if (p.FromObject) { names[i] = null; continue; } // the pooled slot holds whatever an earlier renter left: write it before it is read
- throw NoMatch(expression, scan ? TextNameCache.Names(Command) : real!.Names);
+ throw NoMatch(expression, scan ? SqlTextParameters.Parse(Command) : real!.Names);
}
names[i] = name;
@@ -1078,7 +1078,7 @@ void Apply(
for (int j = i + 1; j < count; j++)
{
if (names[j] is { } second && DbQueryBinding.SameName(first, second))
- throw Collision(first, list[i], list[j], scan ? TextNameCache.Names(Command) : real?.Names ?? default);
+ throw Collision(first, list[i], list[j], scan ? SqlTextParameters.Parse(Command) : real?.Names ?? default);
}
}
@@ -1312,7 +1312,7 @@ static ValueTask> EnsureOpenScopeUnlessOpenAsync(
CancellationToken cancellationToken)
{
ConnectionState state = connection.State;
- if ((state & (ConnectionState.Open | ConnectionState.Broken)) == ConnectionState.Open)
+ if (!ConnectionExtensions.NeedsOpen(state))
{
return new ValueTask>(
pool is null
diff --git a/Source/Core/Extensions/DataReader.cs b/Source/Core/Extensions/DataReader.cs
index f1abaf2a..b58dec89 100644
--- a/Source/Core/Extensions/DataReader.cs
+++ b/Source/Core/Extensions/DataReader.cs
@@ -308,8 +308,6 @@ public static IEnumerable Select(
static async IAsyncEnumerable