UDataset.DM 0.14.2

dotnet add package UDataset.DM --version 0.14.2
                    
NuGet\Install-Package UDataset.DM -Version 0.14.2
                    
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="UDataset.DM" Version="0.14.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="UDataset.DM" Version="0.14.2" />
                    
Directory.Packages.props
<PackageReference Include="UDataset.DM" />
                    
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 UDataset.DM --version 0.14.2
                    
#r "nuget: UDataset.DM, 0.14.2"
                    
#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 UDataset.DM@0.14.2
                    
#: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=UDataset.DM&version=0.14.2
                    
Install as a Cake Addin
#tool nuget:?package=UDataset.DM&version=0.14.2
                    
Install as a Cake Tool

UDataset.DM

UDataset.DM 是 UDataset 跨数据库数据访问框架的达梦数据库(Dameng DB)实现模块。

概述

本模块提供对达梦数据库(DM8)的完整支持,包括:

  • 数据库连接管理
  • SQL语法转换
  • Schema管理(表、列、索引等)
  • 用户权限管理
  • 数据库管理

安装

通过 NuGet 安装:

dotnet add package UDataset.DM

使用方法

1. 注册提供者

在应用程序启动时注册DM提供者:

using UDataset.DM;

// 注册DM数据库提供者
DMBootstrapper.Register();

2. 创建连接

using UDataset.Core;
using System.Data.Common;

// 创建连接字符串构建器
var connectionStringBuilder = new DbConnectionStringBuilder();
connectionStringBuilder["Server"] = "localhost";
connectionStringBuilder["Port"] = "5236";
connectionStringBuilder["Database"] = "DM";
connectionStringBuilder["User Id"] = "SYSDBA";
connectionStringBuilder["Password"] = "SYSDBA";

// 获取连接
var factory = DBProviderRegistry.GetFactory("DM");
var connection = factory.CreateConnection(connectionStringBuilder);

3. 执行查询

// 查询数据
var rows = await connection.RetrieveAsync("MY_TABLE", 
    new Dictionary<string, object> { ["STATUS"] = "ACTIVE" });

// 插入数据
var newRow = new Row { ["NAME"] = "测试", ["VALUE"] = 100 };
await connection.CreateAsync("MY_TABLE", newRow);

// 更新数据
await connection.UpdateAsync("MY_TABLE", 
    new Dictionary<string, object> { ["ID"] = 1 },
    new Row { ["VALUE"] = 200 });

// 删除数据
await connection.DeleteAsync("MY_TABLE", 
    new Dictionary<string, object> { ["ID"] = 1 });

特性

SQL语法适配

  • 参数前缀: : (冒号)
  • 标识符包裹: " (双引号)
  • 分页语法: LIMIT/OFFSET
  • 支持DUAL虚拟表
  • 参数限制: 1000个/批次

类型映射

UDataset类型 DM类型
String VARCHAR
Int32 INT
Int64 BIGINT
Decimal DECIMAL
Double DOUBLE
Float FLOAT
Boolean BIT
DateTime TIMESTAMP
Guid VARCHAR(36)
Binary BLOB
Text TEXT

支持的操作

  • ✅ 表创建/删除/修改
  • ✅ 列添加/修改/删除
  • ✅ 索引创建/删除
  • ✅ 用户创建/删除/权限管理
  • ✅ 数据CRUD操作
  • ✅ 批量操作
  • ✅ 事务支持

依赖

  • UDataset.Core (核心框架)
  • Dapper (ORM映射)
  • Dm.DmProvider 8.3.1.47463 (达梦数据库驱动)

注意事项

  1. 标识符大小写: DM默认将未引用的标识符转换为大写,建议使用双引号包裹需要保持大小写的标识符

  2. 参数兼容性: DmProvider是为.NET Framework设计的,在.NET 8上运行可能会有兼容性警告,但功能正常

  3. 批量操作: 由于DM的参数限制,批量操作会被自动分批执行

版本历史

  • 0.14.0 (2026-08-06) - 修复:管理操作超时传播、授权映射调整、索引查询排除 CLUSTER/LOB、WhenNotExists 自增主键旁路;全量回归通过
  • 0.11.0 (2026-04-16) - 正式发布,支持完整的数据库操作,测试通过
  • 0.10.4 - 初始实现,支持基本的数据库操作

许可证

MIT License

Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.14.2 96 8/9/2026
0.14.1 98 8/9/2026
0.14.0 108 8/7/2026
0.13.0 105 5/7/2026
0.12.2 104 4/30/2026
0.12.1 117 4/29/2026
0.12.0 113 4/28/2026
0.11.3 117 4/23/2026
0.11.2 109 4/19/2026
0.11.1 121 4/17/2026
0.11.0 107 4/16/2026