W.DamengProvider 0.3.0

dotnet add package W.DamengProvider --version 0.3.0
                    
NuGet\Install-Package W.DamengProvider -Version 0.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="W.DamengProvider" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="W.DamengProvider" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="W.DamengProvider" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add W.DamengProvider --version 0.3.0
                    
#r "nuget: W.DamengProvider, 0.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package W.DamengProvider@0.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=W.DamengProvider&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=W.DamengProvider&version=0.3.0
                    
Install as a Cake Tool

W.DamengProvider

面向达梦(Dameng)数据库的 .NET 6/8/9/10 ADO.NET 数据提供程序,提供异步数据库操作、参数绑定、本地事务、DmDataSource、流式 BLOB/CLOB 和标准 .NET 诊断接口。

这是社区维护的 ADO.NET 项目。包名和程序集名为 W.DamengProvider,公开命名空间为 W.Dm。它与 DM.DmProvider 有不同的程序集身份,现有应用和 EF 适配层需要显式更新依赖并重新编译。

安装

版本 0.3.0;发布状态、身份、公开安装验证和覆盖范围见发布记录。

dotnet add package W.DamengProvider --version 0.3.0

0.3.0 提供 netstandard2.1;net6.0;net8.0;net9.0;net10.0;现代四目标包含数组绑定与 DbBatch、存储过程/输出游标、异步元数据和 EF 接入反馈修订,旧资产差异见下文。旧版 0.1.0-preview.1 仅包含 net10.0。构建使用 global.json 固定的 SDK 10.0.401,与应用运行时分开管理。各目标的实测结果见发布记录、多目标兼容记录和 .NET 6 兼容记录。

net6.0 依赖官方 Microsoft.Bcl.TimeProvider 8.0.1(传递依赖 Microsoft.Bcl.AsyncInterfaces 8.0.0),net8.0 依赖官方 Microsoft.Bcl.Cryptography 10.0.12(传递依赖 System.Formats.Asn1 10.0.12);net9.0 和 net10.0 无额外运行时 NuGet 依赖。.NET 6 没有 DbDataSource,该目标的 DmDataSource 只提供同名 typed 成员,不能经 DbDataSource/DbProviderFactory 多态使用。按微软生命周期政策,.NET 6 已于 2024-11-12 结束支持,.NET 8/9 支持期均到 2026-11-10;库兼容验证不延长运行时维护期。

本版本包含 issue #16 修订及后续调整,包括传输失败分类、事务内 DML 块、时间 typed NULL、已验证 profile 的 CLR 时间值 Scale 8/9 无损写入、有限的 Prepare/绑定失败恢复和 ServerCapabilities。本版本还支持 存储过程、标量输出/返回值与受管输出游标。阅读兼容文档时请区分源码行为与包版本。

0.3.0 在现有四目标之外新增受限 netstandard2.1 资产,供 .NET Core 3.1 应用及 Standard 2.1 类库消费。该资产不提供 TLS、DbBatch 或 DateOnly/TimeOnly 映射;默认 RequireTls 不变,仅明确允许明文的服务器与显式 PlaintextAllowed 组合可以连接。范围见旧目标兼容记录,本轮检查见0.3.0 发布记录。已发布 0.2.0 不含旧资产。

使用

连接串由应用配置或 secret store 提供。默认要求完整会话 TLS,并验证证书;根据服务器配置指定 CA、客户端证书和私钥路径。

using W.Dm;

var settings = new DmConnectionStringBuilder(
    Environment.GetEnvironmentVariable("DAMENG_CONNECTION_STRING")
    ?? throw new InvalidOperationException("Missing database configuration"))
{
    TransportSecurity = DmTransportSecurity.RequireTls
};

await using var source = DmDataSource.Create(settings.ConnectionString);
await using var connection = await source.OpenConnectionAsync();
await using var command = connection.CreateCommand();
command.CommandText = "SELECT 1 FROM DUAL";
var value = await command.ExecuteScalarAsync();

需要 DbProviderFactories 时,可由应用调用 DbProviderFactories.RegisterFactory("W.DamengProvider", DmClientFactory.Instance) 注册。

支持与限制

  • 支持同步及异步 Open、Prepare、Execute、Read、NextResult 和本地事务。取消或超时发生于发送之后时,可能关闭物理连接;未确认的提交通过 OutcomeUnknown 报告,不自动重试或重放。
  • 默认 ReadCommitted。保存点及额外隔离级别依赖服务器 profile;详细边界见事务兼容说明。
  • DmDataSource 提供独立容量调度;当前每次租用建立新物理会话、归还即丢弃,尚不提供物理连接复用的性能收益。
  • BLOB/CLOB 支持与当前 Reader 行、执行和事务绑定的流式读取。完整物化 API 限制为 64 MiB 返回载荷。流式输入需显式声明 BLOB/CLOB 类型,由调用者管理输入生命周期。
  • CLR 时间值保持 100ns tick 精度;服务器或目标列不能精确表示的值会被拒绝。七位小数写入仅在已验证 profile 开放,详见时间兼容说明。
  • 已验证环境包括 DM 8.1.5.60 / UTF-8 和 DM 8.1.4.6 / GB18030 / TLS;其他服务器版本需单独验证。原生加密、批量装载、自动重连、分布式事务及部分旧功能不在支持范围。
  • ActivitySource 和 Meter 的名称继续使用 W.DmProvider,便于现有监控配置延续。

完整边界见R3 兼容说明。本项目不附带数据库服务端或第三方原生库。

开发与发布

发布准备、测试和 tag 规则见发布指南。本地实库测试仅使用专用 TEST 账号,配置见本地达梦环境。

后续缺口及已实现能力见路线图。开发脚本入口见 eng 和 scripts。

许可

Apache-2.0。包含上游 DM 的 C# 代码贡献和本项目的修改,版权及第三方说明见 THIRD-PARTY-NOTICES.md 与 LICENSE。

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on W.DamengProvider:

Package Downloads
W.EntityFrameworkCore.Dameng.WDriver

Runs the W.EntityFrameworkCore.Dameng provider on the W.DamengProvider ADO.NET driver (asynchronous network I/O, cancellation, failure outcomes, 100ns temporal precision). Select it with UseDamengWithWDriver.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0 61 10/17/2026
0.2.0 71 10/15/2026
0.1.0-preview.1 52 10/13/2026