From 890e1c989ef1a5e2a8d5c79cab2058beef6ae7b3 Mon Sep 17 00:00:00 2001 From: electricessence <5899455+electricessence@users.noreply.github.com> Date: Sat, 5 Dec 2026 10:15:47 -0800 Subject: [PATCH 1/3] Version 11.0.0 Builds the stable 11.0.0 packages: the release candidate version suffix is removed from Source/Directory.Build.props, so a Release build is 11.0.0 (a Debug build keeps its debug suffix). The install commands lose --prerelease (the root README, the four package READMEs and the getting-started guide), and "Version 11 is a release candidate" is gone from the root README, the docsite home page and the getting-started guide. The release notes get a "Version 11.0.0" section, "Changes since rc.18", with the seven bullets that landed after the last candidate (the return code on a text command, the first column of a duplicated name, and the three fixes of the final pass); the history of the candidates stays below it. The migration guide points to the release notes for each change, and loses the one row that mapped names that existed only in the candidates. The guide also names only EnableAsyncRead(bool) as replaced by AsyncReads() (UseAsyncRead and the useReadAsync argument still exist), and names the right members a custom IExecuteReader implements. The performance-charts guide says "after a release". Behavior change: none; the code is unchanged. Co-Authored-By: Claude Sonnet 5.5 --- README.md | 4 ++-- Source/Channel/README.md | 2 +- Source/Core/README.md | 2 +- Source/Dataflow/README.md | 2 +- Source/Directory.Build.props | 2 -- Source/MSSqlClient/README.md | 2 +- docsite/articles/getting-started.md | 4 ++-- docsite/articles/release-notes.md | 17 +++++++++++------ docsite/articles/whats-new-11.md | 7 +++---- docsite/index.md | 2 +- docsite/tools/perf/README.md | 2 +- 11 files changed, 24 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index c17970c0..9890b831 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ Post[] posts = await connectionFactory ## Install ```sh -dotnet add package Open.Database.Extensions.Core --prerelease +dotnet add package Open.Database.Extensions.Core dotnet add package Microsoft.Data.Sqlite ``` @@ -94,7 +94,7 @@ dotnet add package Microsoft.Data.Sqlite | `Open.Database.Extensions.Dataflow` | Rows into TPL Dataflow blocks. | | `Open.Database.Extensions.MSSqlClient` | `SqlConnectionFactory` and SQL Server specializations on `Microsoft.Data.SqlClient`. | -Targets: `netstandard2.0`, `netstandard2.1`, `net10.0` and `net11.0` (`MSSqlClient`: `net472`, `net10.0` and `net11.0`). Version 11 is a release candidate. +Targets: `netstandard2.0`, `netstandard2.1`, `net10.0` and `net11.0` (`MSSqlClient`: `net472`, `net10.0` and `net11.0`). ## Performance diff --git a/Source/Channel/README.md b/Source/Channel/README.md index 6e621f8c..4d9d0c50 100644 --- a/Source/Channel/README.md +++ b/Source/Channel/README.md @@ -5,7 +5,7 @@ Read a query's rows into a `System.Threading.Channels` channel that any consumer or pipeline can read. The query fills the channel in the background while your consumer works, and the connection is closed when the last row is read, however slowly the consumer reads. ```sh -dotnet add package Open.Database.Extensions.Channel --prerelease +dotnet add package Open.Database.Extensions.Channel dotnet add package Open.ChannelExtensions # optional: Transform, Batch, Join and ReadAll for the rows ``` diff --git a/Source/Core/README.md b/Source/Core/README.md index 09b35bd9..7a07e033 100644 --- a/Source/Core/README.md +++ b/Source/Core/README.md @@ -5,7 +5,7 @@ You write the SQL. Open.Database.Extensions (ODX) writes the ADO.NET around it: the connection, the parameters, the read loop, the mapping to your types and the disposal. It works with any ADO.NET provider and holds a connection open only while a query needs it. ```sh -dotnet add package Open.Database.Extensions.Core --prerelease +dotnet add package Open.Database.Extensions.Core dotnet add package Microsoft.Data.Sqlite # your provider; SQLite is used below ``` diff --git a/Source/Dataflow/README.md b/Source/Dataflow/README.md index bc378c6c..b4aee475 100644 --- a/Source/Dataflow/README.md +++ b/Source/Dataflow/README.md @@ -5,7 +5,7 @@ Send a query's rows into a TPL Dataflow pipeline you build. The blocks, their schedulers and their priorities stay yours; the query is read at the provider's pace, and the connection is closed when the read ends. ```sh -dotnet add package Open.Database.Extensions.Dataflow --prerelease +dotnet add package Open.Database.Extensions.Dataflow ``` ```cs diff --git a/Source/Directory.Build.props b/Source/Directory.Build.props index eb7f0907..48a5f8d7 100644 --- a/Source/Directory.Build.props +++ b/Source/Directory.Build.props @@ -5,8 +5,6 @@ 11.0.0 debug - - rc.18 diff --git a/Source/MSSqlClient/README.md b/Source/MSSqlClient/README.md index b0890032..4471b12b 100644 --- a/Source/MSSqlClient/README.md +++ b/Source/MSSqlClient/README.md @@ -5,7 +5,7 @@ SQL Server for Open.Database.Extensions: `SqlConnectionFactory`, stored procedures whose parameters are named from your arguments, and output parameters read into a model, on `Microsoft.Data.SqlClient`. It brings [Open.Database.Extensions.Core](https://www.nuget.org/packages/Open.Database.Extensions.Core/) and the provider with it, so it is the only package to install. ```sh -dotnet add package Open.Database.Extensions.MSSqlClient --prerelease +dotnet add package Open.Database.Extensions.MSSqlClient ``` ```cs diff --git a/docsite/articles/getting-started.md b/docsite/articles/getting-started.md index aafdd7fd..765b7569 100644 --- a/docsite/articles/getting-started.md +++ b/docsite/articles/getting-started.md @@ -11,10 +11,10 @@ Most applications need one package. The others add integrations. | `Open.Database.Extensions.Dataflow` | [Reading into dataflow blocks](channels-and-dataflow.md) | same | | `Open.Database.Extensions.MSSqlClient` | `SqlConnectionFactory` and SQL Server specializations on `Microsoft.Data.SqlClient` | `net472`, `net10.0`, `net11.0` | -.NET 8 and .NET 9 applications use the `netstandard2.1` build; .NET Framework applications use `netstandard2.0` (or `net472` for the SQL Server package). Version 11 is a release candidate, so ask for prereleases: +.NET 8 and .NET 9 applications use the `netstandard2.1` build; .NET Framework applications use `netstandard2.0` (or `net472` for the SQL Server package). To use it, add the Core package, which the other packages build on: ```sh -dotnet add package Open.Database.Extensions.Core --prerelease +dotnet add package Open.Database.Extensions.Core ``` Core does not reference any database provider. Bring your own: the examples in this guide use `Microsoft.Data.Sqlite` so that you can run them without a server: diff --git a/docsite/articles/release-notes.md b/docsite/articles/release-notes.md index e389f83b..22ec24f0 100644 --- a/docsite/articles/release-notes.md +++ b/docsite/articles/release-notes.md @@ -1,15 +1,23 @@ # Release notes -Version 11 is `11.0.0-rc.18`. For moving a 10.x codebase, read [Coming from earlier versions](whats-new-11.md) first; this page lists each release. +Version 11 is `11.0.0`. For moving a 10.x codebase, read [Coming from earlier versions](whats-new-11.md) first; this page lists each release. -## Version 11 release candidates +## Version 11.0.0 -### Changes since rc.17 +### Changes since rc.18 - **Changed: a return code read on a text command or a text definition no longer throws.** `ExecuteReturnAsync()` on a call of a `DbNonQuery.Text` definition, a `ReturnValue` member in `ExecuteOutputAsync()` on a text command or in `Output()` on a text definition, and `CaptureReturn` (or a captured model with a `ReturnValue` member) on a text command or a text definition threw `InvalidOperationException` ("needs a stored procedure"); they now run and give what the provider reports for a text command (SQL Server: 0, and `RETURN n` in text is a server error). A return code comes from a stored procedure called by name; from text, read it with `EXEC @r = dbo.p` and an output parameter. The command of the SQL Server package is the exception: the next item. - **Changed: the SQL Server command refuses a return code on a text command.** On an `ExpressiveSqlCommand` whose type is text, `ExecuteReturnAsync()`, `ExecuteReturnAsync()` and `ExecuteReturn()` ran and gave 0 (`RETURN n` in text was a server error), and a `ReturnValue` member in `ExecuteOutputAsync()` and `CaptureReturn` threw `InvalidOperationException` with a message about stored procedures; all of them now throw `InvalidOperationException` before a connection is used, and the message says to call the procedure by name or to read the code with `EXEC @r = dbo.p` and an output parameter. A stored procedure called by name is unchanged, and so is a definition (`DbNonQuery.Text`) on a `SqlConnection`, which gives what SQL Server reports. - **Changed: `ExecuteReturnAsync()` on a command refuses at the call.** A token that is already canceled, a capture of the return code beside the call, and the refusals above are thrown by the call itself, as `ExecuteReturnAsync()` already did, instead of by the returned task. - **Changed: `MatchingOrdinals` takes the first column of a name that more than one column has.** With duplicate names in a result set, `MatchingOrdinals(sort: false)` gave the last of the columns and `MatchingOrdinals(sort: true)` gave all of them; both now give the first one, as `GetOrdinal` does, so the two modes agree and a name is one column. To read another column of the same name, alias it in SQL. +- **Fixed: `AddParameter(name, value, type, direction)` accepts a `null` name for a return value.** It threw `ArgumentNullException` for a `null` name whatever the direction, though a return value needs no name and `AddParameterType` already accepted it; it now adds an unnamed return parameter, as `AddParameterType` does, and still throws for any other direction. +- **Fixed: a canceled parameter-name lookup is no longer remembered as "no names".** When the call was canceled while the provider's `GetSchemaAsync` threw `ArgumentException`, `NotSupportedException` or `NotImplementedException`, the lookup took that as "the provider reports no names" and kept it, so later calls of the procedure did not look again; the call ends canceled (`OperationCanceledException`) and nothing is kept, as for the output-parameter metadata. +- **Changed: constructing a command or calling `Command` or `StoredProcedure` on a transaction that has no connection throws `InvalidOperationException`.** The constructors that take a transaction (`ExpressiveCommand`, `ExpressiveDbCommand`, `ExpressiveSqlCommand`) and the `Command` and `StoredProcedure` extensions of `IDbTransaction` and `DbTransaction` threw `ArgumentNullException` named `connection` for a transaction that has completed; they now throw `InvalidOperationException`, with a message that says the cause and the fix, as `CreateCommand` does. A `null` transaction still throws `ArgumentNullException` named `transaction`. + +## Version 11 release candidates + +### Changes since rc.17 + - **Removed: the protected `PrepareCommand(TConnection)` and `ConnectionProvider` of `ExpressiveCommandBase`.** A class of your own that derives from `ExpressiveCommandBase` and called one of them no longer compiles. There is no replacement: a terminal builds the command when it runs, and a subclass that needs the connection, pool or factory keeps its own reference to what it passed to the base constructor. - **Changed: a procedure with a schema in its name has its parameter names read once per server and database, not once per source of connections.** A command or query of the library's own types that runs on a `DbConnection` which reports both its server (`DataSource`) and its `Database` finds the names of `dbo.get_author` there, whichever connection, factory, pool or transaction it was made from, so a connection created for each call no longer asks the database every time. The names are kept for the life of the process, for connections of one kind of provider (one connection class); up to 1024 procedures are shared, and past that new names stay with their source and nothing is dropped. A name without a schema, an answer of no names, a connection that reports no server or no database, and a command class of your own stay with the source of the connections, as before. The parameter modes and scales that the output-parameter check reads are shared the same way. What to know: every login of the process sees the names (a name that matches no parameter throws with the list of what the procedure declares); a server is told by the name it reports; a test fake that reports a fixed server name shares names with every other such fake, so give each its own name or none; and a failure that forgets the names forgets them for every connection. See [Parameter names are read once](expressive-commands.md#parameter-names-are-read-once). - **Fixed: a command made from a factory, a pool or a function read a procedure's parameter names again for every command.** A command made from a factory or pool that implements only the non-generic interface, or from a `Func` or a `Func` through `Command` or `StoredProcedure`, kept a separate cache per command, so the first run of every command asked the database for the names. Commands made from the same factory, pool or function now share one cache. Different factories, pools and functions still do not share. A function is told apart by the object its method belongs to: lambdas that capture nothing, in one class, are one source and share; a lambda that captures a local variable or a parameter and is built again for each call is a new source each time, so keep one factory for the application. @@ -19,9 +27,6 @@ Version 11 is `11.0.0-rc.18`. For moving a 10.x codebase, read [Coming from earl - **Fixed: the name of the `ArgumentNullException` from `AsGeneric(IDbConnectionPool)`.** A `null` pool threw with the parameter name `source`; it is now `connectionPool`. - **Changed: more exception messages say what to do.** A blank command (on `CreateCommand` of a connection too), a blank parameter name, a negative count or index, a type with no public constructor given to `Map()`, a mapping with no property name, parameter names that collide, a parameter name that cannot be derived from an argument, and a stream enumerated a second time each name the cause and the fix. - **Changed: `CreateCommand`, `CreateTextCommand` and `CreateStoredProcedureCommand` on a transaction that has no connection check the connection first.** With a null or blank command text as well, they now throw the `InvalidOperationException` for the missing connection; before, the text was checked first and `ArgumentException` was thrown. -- **Fixed: `AddParameter(name, value, type, direction)` accepts a `null` name for a return value.** It threw `ArgumentNullException` for a `null` name whatever the direction, though a return value needs no name and `AddParameterType` already accepted it; it now adds an unnamed return parameter, as `AddParameterType` does, and still throws for any other direction. -- **Fixed: a canceled parameter-name lookup is no longer remembered as "no names".** When the call was canceled while the provider's `GetSchemaAsync` threw `ArgumentException`, `NotSupportedException` or `NotImplementedException`, the lookup took that as "the provider reports no names" and kept it, so later calls of the procedure did not look again; the call ends canceled (`OperationCanceledException`) and nothing is kept, as for the output-parameter metadata. -- **Changed: constructing a command or calling `Command` or `StoredProcedure` on a transaction that has no connection throws `InvalidOperationException`.** The constructors that take a transaction (`ExpressiveCommand`, `ExpressiveDbCommand`, `ExpressiveSqlCommand`) and the `Command` and `StoredProcedure` extensions of `IDbTransaction` and `DbTransaction` threw `ArgumentNullException` named `connection` for a transaction that has completed; they now throw `InvalidOperationException`, with a message that says the cause and the fix, as `CreateCommand` does. A `null` transaction still throws `ArgumentNullException` named `transaction`. ### Changes since rc.16 diff --git a/docsite/articles/whats-new-11.md b/docsite/articles/whats-new-11.md index a3756da4..87fdc622 100644 --- a/docsite/articles/whats-new-11.md +++ b/docsite/articles/whats-new-11.md @@ -2,7 +2,7 @@ Version 11 is a significant break from 10.x: rebuild every consumer, because 11 is not binary compatible with 10.x. The ADO.NET extensions themselves changed little. How typed results are mapped and returned changed a lot. This page is for a person or a coding agent moving a 10.x codebase to 11, grouped by theme. The rest of the documentation describes version 11 only. -Each member that is gone has a replacement that is shorter, and the old way is not kept beside it. The compiler names the member that is missing; find it here by its theme. For the release candidates one by one, see the [release notes](release-notes.md). +Each member that is gone has a replacement that is shorter, and the old way is not kept beside it. The compiler names the member that is missing; find it here by its theme. For each change of version 11 in order, see the [release notes](release-notes.md). Packages: use `Open.Database.Extensions.MSSqlClient` (on `Microsoft.Data.SqlClient`) for SQL Server. The `Open.Database.Extensions.SqlClient` package (on `System.Data.SqlClient`) is not published for 11; every type in it has its twin in `MSSqlClient`. Version 11 targets `net11.0` next to `net10.0`, `netstandard2.0` and `netstandard2.1` (`MSSqlClient`: `net472`, `net10.0` and `net11.0`). @@ -120,8 +120,7 @@ await foreach (Post post in command |---|---| | `Read`, `ReadAsync`, `ForEachAsync`, `IterateReader*` handlers on a command or mapped query | `Stream(stallTimeout, ct)`, or a buffered terminal | | `ToAsyncBuffer(pool, clearOnReturn, ct)` and the flag and pool overloads of the buffer streams | `.UsePool(pool, clearOnReturn).ToPooledBuffer(ct)` | -| `ToAsyncBuffer`, `ToAsyncBufferStream`, `ToBufferedAsyncStream` (11.0 release candidates) | `ToPooledBuffer`, `ToPooledBufferStream`, `ToPooledStream` | -| `EnableAsyncRead(bool)`, `UseAsyncRead`, the `useReadAsync` argument | `AsyncReads()` before or after `Map` | +| `EnableAsyncRead(bool)` | `AsyncReads()` before or after `Map` | | a reader helper's `throwOnCancellation` argument | delete it: a cancel that cuts the read short throws `OperationCanceledException` | Rows are read with `Read()` by default, on async terminals too; `AsyncReads()` opts in to `ReadAsync()`. The token can be passed positionally after the other optional arguments of every terminal, so `reader.ForEachAsync(handler, default)` binds the token and reads with `ReadAsync`. See [Pooled buffers and streams](async-buffers.md) and [AsyncReads()](async-reads.md). @@ -172,7 +171,7 @@ Every mapped overload takes one `RowMap? map` where 10.x took key/value pairs - `record.GetMatchingOrdinals(names, sort)`: `record.MatchingOrdinals(names, sort).ToArray()`. - The `(string Name, int Ordinal)` tuple of `OrdinalMapping`, `GetOrdinalMapping`, `MatchingOrdinals` and `ToDictionary(ordinalMapping)`: `ColumnOrdinal`. Deconstruction, `.Name` and `.Ordinal` work as before; a tuple does not convert to it, so write `new ColumnOrdinal(name, ordinal)`. It is not comparable as the tuple was: sort by `.Ordinal` or `.Name`. `ToDictionary` with a null record and an empty input now throws `ArgumentNullException` instead of returning an empty dictionary. - `Stream` callers who relied on one or two rows read ahead: use `StreamBuffered(stallTimeout, 1, ct)`. -- A custom `IExecuteReader` must implement the state-passing `ExecuteReader` overloads and an `ExecuteReaderAsync` that takes the call's token; a custom `IMappedQuery` implements `ToPooledBufferStream`, `Stream` and both `StreamBuffered` overloads. +- A custom `IExecuteReader` must implement the two state-passing `ExecuteReaderAsync` overloads, one of which takes the call's token; a custom `IMappedQuery` implements `ToPooledBufferStream`, `Stream` and both `StreamBuffered` overloads. - A static property is not mapped. ## Known limitations diff --git a/docsite/index.md b/docsite/index.md index 61eda37e..bbefd25c 100644 --- a/docsite/index.md +++ b/docsite/index.md @@ -4,7 +4,7 @@ title: Open.Database.Extensions (ODX) ![Open.Database.Extensions: You write the SQL. ODX writes the other twenty lines.](images/hero-core.svg) -Extensions on the standard ADO.NET types that make everyday database work short to write and robust by default. Version 11 is a release candidate. +Extensions on the standard ADO.NET types that make everyday database work short to write and robust by default. ![The features of ODX v11, one slide at a time.](images/feature-slideshow.svg) diff --git a/docsite/tools/perf/README.md b/docsite/tools/perf/README.md index bd59d720..5363bb34 100644 --- a/docsite/tools/perf/README.md +++ b/docsite/tools/perf/README.md @@ -22,7 +22,7 @@ Each SVG follows the operating system's light or dark setting and draws its own ## Updating the performance charts -Do this after a release candidate, or when a change moves performance. The numbers published on the site are +Do this after a release, or when a change moves performance. The numbers published on the site are meant to come from the current `master`: a pull request that changes the charts is reviewed on whatever results exist, and it merges only with data from a fresh run on current `master`. The run date, the build (the commit of the benchmark project that ran) and the machine are shown on the [data files](../../articles/performance-data.md) page, so a reader can From 74ab7f55bd26becf3ef8ad55835115176b042c96 Mon Sep 17 00:00:00 2001 From: electricessence <5899455+electricessence@users.noreply.github.com> Date: Sat, 5 Dec 2026 10:22:40 -0800 Subject: [PATCH 2/3] Track the public API of Channel and Dataflow The two packages get the public API analyzer on net10.0 and net11.0, as Core and MSSqlClient have it, and a PublicAPI.Shipped.txt that lists what each one ships today: 17 entries for Channel (ChannelDbExtensions) and 7 for Dataflow (DataflowExtensions). PublicAPI.Unshipped.txt is empty. From here a change of their public surface is a build finding until it is declared. The files only record what ships; no member changes. Both projects build with 0 warnings. Behavior change: none. Co-Authored-By: Claude Sonnet 5.5 --- .../Open.Database.Extensions.Channel.csproj | 9 +++++++++ Source/Channel/PublicAPI.Shipped.txt | 18 ++++++++++++++++++ Source/Channel/PublicAPI.Unshipped.txt | 1 + .../Open.Database.Extensions.Dataflow.csproj | 9 +++++++++ Source/Dataflow/PublicAPI.Shipped.txt | 8 ++++++++ Source/Dataflow/PublicAPI.Unshipped.txt | 1 + 6 files changed, 46 insertions(+) create mode 100644 Source/Channel/PublicAPI.Shipped.txt create mode 100644 Source/Channel/PublicAPI.Unshipped.txt create mode 100644 Source/Dataflow/PublicAPI.Shipped.txt create mode 100644 Source/Dataflow/PublicAPI.Unshipped.txt diff --git a/Source/Channel/Open.Database.Extensions.Channel.csproj b/Source/Channel/Open.Database.Extensions.Channel.csproj index e6c13dbe..251d1873 100644 --- a/Source/Channel/Open.Database.Extensions.Channel.csproj +++ b/Source/Channel/Open.Database.Extensions.Channel.csproj @@ -9,6 +9,15 @@ + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/Source/Channel/PublicAPI.Shipped.txt b/Source/Channel/PublicAPI.Shipped.txt new file mode 100644 index 00000000..bf0a74ea --- /dev/null +++ b/Source/Channel/PublicAPI.Shipped.txt @@ -0,0 +1,18 @@ +#nullable enable +Open.Database.Extensions.ChannelDbExtensions +static Open.Database.Extensions.ChannelDbExtensions.ToBoundedChannel(this Open.Database.Extensions.IMappedQuery! source, int capacity, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Channels.Channel! +static Open.Database.Extensions.ChannelDbExtensions.ToBoundedChannelReader(this Open.Database.Extensions.IMappedQuery! source, int capacity, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Channels.ChannelReader! +static Open.Database.Extensions.ChannelDbExtensions.ToChannel(this Open.Database.Extensions.IMappedQuery! source, bool singleReader, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Channels.Channel! +static Open.Database.Extensions.ChannelDbExtensions.ToChannel(this Open.Database.Extensions.IMappedQuery! source, out System.Threading.Tasks.Task! readCount, bool singleReader, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Channels.Channel! +static Open.Database.Extensions.ChannelDbExtensions.ToChannel(this Open.Database.Extensions.IMappedQuery! source, out System.Threading.Tasks.Task! readCount, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Channels.Channel! +static Open.Database.Extensions.ChannelDbExtensions.ToChannel(this Open.Database.Extensions.IMappedQuery! source, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Channels.Channel! +static Open.Database.Extensions.ChannelDbExtensions.ToChannel(this Open.Database.Extensions.IMappedQuery! source, System.Threading.Channels.Channel! channel, bool complete, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static Open.Database.Extensions.ChannelDbExtensions.ToChannel(this Open.Database.Extensions.IMappedQuery! source, System.Threading.Channels.Channel! channel, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static Open.Database.Extensions.ChannelDbExtensions.ToChannel(this Open.Database.Extensions.IMappedQuery! source, System.Threading.Channels.ChannelWriter! writer, bool complete, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static Open.Database.Extensions.ChannelDbExtensions.ToChannel(this Open.Database.Extensions.IMappedQuery! source, System.Threading.Channels.ChannelWriter! writer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static Open.Database.Extensions.ChannelDbExtensions.ToChannelHoldingConnection(this Open.Database.Extensions.IMappedQuery! source, System.Threading.Channels.Channel! channel, System.TimeSpan stallTimeout, bool complete, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static Open.Database.Extensions.ChannelDbExtensions.ToChannelHoldingConnection(this Open.Database.Extensions.IMappedQuery! source, System.Threading.Channels.Channel! channel, System.TimeSpan stallTimeout, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static Open.Database.Extensions.ChannelDbExtensions.ToChannelHoldingConnection(this Open.Database.Extensions.IMappedQuery! source, System.Threading.Channels.ChannelWriter! writer, System.TimeSpan stallTimeout, bool complete, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static Open.Database.Extensions.ChannelDbExtensions.ToChannelHoldingConnection(this Open.Database.Extensions.IMappedQuery! source, System.Threading.Channels.ChannelWriter! writer, System.TimeSpan stallTimeout, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static Open.Database.Extensions.ChannelDbExtensions.ToChannelReader(this Open.Database.Extensions.IMappedQuery! source, bool singleReader, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Channels.ChannelReader! +static Open.Database.Extensions.ChannelDbExtensions.ToChannelReader(this Open.Database.Extensions.IMappedQuery! source, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Channels.ChannelReader! diff --git a/Source/Channel/PublicAPI.Unshipped.txt b/Source/Channel/PublicAPI.Unshipped.txt new file mode 100644 index 00000000..7dc5c581 --- /dev/null +++ b/Source/Channel/PublicAPI.Unshipped.txt @@ -0,0 +1 @@ +#nullable enable diff --git a/Source/Dataflow/Open.Database.Extensions.Dataflow.csproj b/Source/Dataflow/Open.Database.Extensions.Dataflow.csproj index 79730b54..9d645be9 100644 --- a/Source/Dataflow/Open.Database.Extensions.Dataflow.csproj +++ b/Source/Dataflow/Open.Database.Extensions.Dataflow.csproj @@ -13,6 +13,15 @@ + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/Source/Dataflow/PublicAPI.Shipped.txt b/Source/Dataflow/PublicAPI.Shipped.txt new file mode 100644 index 00000000..f0d9ec19 --- /dev/null +++ b/Source/Dataflow/PublicAPI.Shipped.txt @@ -0,0 +1,8 @@ +#nullable enable +Open.Database.Extensions.DataflowExtensions +static Open.Database.Extensions.DataflowExtensions.AsSourceBlock(this Open.Database.Extensions.IMappedQuery! source, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Dataflow.IReceivableSourceBlock! +static Open.Database.Extensions.DataflowExtensions.AsSourceBlock(this Open.Database.Extensions.IMappedQuery! source, System.Threading.Tasks.Dataflow.DataflowBlockOptions! options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Dataflow.IReceivableSourceBlock! +static Open.Database.Extensions.DataflowExtensions.ToTargetBlock(this Open.Database.Extensions.IMappedQuery! source, System.Threading.Tasks.Dataflow.ITargetBlock! target, bool complete, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static Open.Database.Extensions.DataflowExtensions.ToTargetBlock(this Open.Database.Extensions.IMappedQuery! source, System.Threading.Tasks.Dataflow.ITargetBlock! target, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static Open.Database.Extensions.DataflowExtensions.ToTargetBlockHoldingConnection(this Open.Database.Extensions.IMappedQuery! source, System.Threading.Tasks.Dataflow.ITargetBlock! target, System.TimeSpan stallTimeout, bool complete, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static Open.Database.Extensions.DataflowExtensions.ToTargetBlockHoldingConnection(this Open.Database.Extensions.IMappedQuery! source, System.Threading.Tasks.Dataflow.ITargetBlock! target, System.TimeSpan stallTimeout, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask diff --git a/Source/Dataflow/PublicAPI.Unshipped.txt b/Source/Dataflow/PublicAPI.Unshipped.txt new file mode 100644 index 00000000..7dc5c581 --- /dev/null +++ b/Source/Dataflow/PublicAPI.Unshipped.txt @@ -0,0 +1 @@ +#nullable enable From f3df6d10f43210ef2c2b5b15ad44f58a4d012ef2 Mon Sep 17 00:00:00 2001 From: electricessence <5899455+electricessence@users.noreply.github.com> Date: Sat, 5 Dec 2026 10:09:38 -0800 Subject: [PATCH 3/3] Drop the else after the return in MatchingOrdinals The if (sort) branch returns, so the unsorted path no longer sits in an else block: one scope less. The foreach that fills the dictionary gets braces. Behavior change: none. Co-Authored-By: Claude Sonnet 5.5 --- Source/Core/Extensions/DataRecord.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Source/Core/Extensions/DataRecord.cs b/Source/Core/Extensions/DataRecord.cs index 4174d42d..5c8d7550 100644 --- a/Source/Core/Extensions/DataRecord.cs +++ b/Source/Core/Extensions/DataRecord.cs @@ -266,18 +266,19 @@ public static IEnumerable MatchingOrdinals(this IDataRecord recor // Return the first actual column, in record order, of each requested name. return FirstColumnOfEachRequestedName(actual, requested); } - else + + // Map actual columns case-insensitively so the requested order can be preserved. + // The first column of a name stays; a later column of the same name is skipped. + var actualColumns = new Dictionary(StringComparer.OrdinalIgnoreCase); + foreach (ColumnOrdinal m in actual) { - // Map actual columns case-insensitively so the requested order can be preserved. - // The first column of a name stays; a later column of the same name is skipped. - var actualColumns = new Dictionary(StringComparer.OrdinalIgnoreCase); - foreach (ColumnOrdinal m in actual) - actualColumns.TryAdd(m.Name, m); - return requestedNames - .Where(actualColumns.ContainsKey) - .Select(c => actualColumns[c]); + actualColumns.TryAdd(m.Name, m); } + return requestedNames + .Where(actualColumns.ContainsKey) + .Select(c => actualColumns[c]); + static IEnumerable FirstColumnOfEachRequestedName( IEnumerable actual, HashSet requested)