DotNetNext /SqlSugar

.Net aot ORM SqlServer ORM Mongodb ORM MySql 瀚高 Postgresql ORM DB2 Hana 高斯 Duckdb C# VB.NET Sqlite ORM Oracle ORM Mysql Orm 虚谷数据库 达梦 ORM 人大金仓 ORM 神通ORM C# ORM , C# ORM .NET ORM NET9 ORM .NET8 ORM ClickHouse ORM QuestDb ,TDengine ORM,OceanBase ORM,GaussDB ORM,Tidb ORM Object/Relational Mapping

★ 5,843⑂ 1,391👁 257⑃ 219● 1,237▤ 97
C#MITCreated 2015-07-13www.donet5.com/Home/Doc
Download: 5.1.4.1875.1.4.187 ↓5.1.4.1872025-03-29
-1
Daily
5,843
stars
1,391
forks
257
watchers
219
prs
1,237
issues
97
releases

README

English |  
    中文

 
 SqlSugar ORM
SqlSugar is .NET open source ORM framework, maintained and updated by Fructose Big Data Technology team, the most easy-to-use ORM out of the box

Advantages: [Low code] [High performance] [Super simple] [Comprehensive features] [ Multi-database compatible] [Suitable products]

 Support .NET
.net framework.net core3.1.ne5.net6.net7.net8 .net9 .net10

 Support database 
MySql、SqlServer、Sqlite、Oracle 、 postgresql、达梦、Mongodb
人大金仓(国产推荐)、神通数据库、瀚高、Access DB2、DuckDb、Hana、OceanBase
TDengine  QuestDb Clickhouse  MySqlConnector、华为 GaussDB 
南大通用 GBase、MariaDB、Tidb、Odbc、Percona Server,
Amazon Aurora、Azure Database for MySQL、
 Google Cloud SQL for MySQL、custom database

 Description
1. Truly achieve zero SQL ORM table building, index and CRUD all support
2. Support.NET millions of big data write, update, subtable and has billions of query statistics mature solutions
3. Support SAAS complete application: cross-database query, audit, tenant sub-database, tenant sub-table and tenant data isolation
4. Support low code + workflow (dynamic class building, dynamic table building, non-entity multi-library compatible with CRUD, JSON TO SQL, custom XML, etc.)
5. Support ValueObject, discriminator, repository, UnitOfWork, DbContext, AOP

  Documentation
|Other |Select  | Insert    | Update  | Delete| 
| ----- | --------- | ----------- | ------- |------- |
 Nuget| Query |  Insert  |Update|    Delete    | 
 Start guide  | Join query  |Insert without entity  | Update without entity  |   Delete without entity    |     |
|Multiple databases | Include query|Include Insert| Include Update| Include Delete 
 |中文文档|Cross database query|Insert by json|Update by json|Delete by json|

  Feature characteristic

  Feature1 : Join query  
Super simple query syntax
cs
var query  = db.Queryable()
            .LeftJoin  ((o, cus) = o.CustomId == cus.Id)
            .LeftJoin ((o, cus, oritem ) = o.Id == oritem.OrderId)
            .LeftJoin ((o, cus, oritem , oritem2) = o.Id == oritem2.OrderId)
            .Where(o = o.Id == 1)  
            .Select((o, cus) = new ViewOrder { Id = o.Id, CustomName = cus.Name })
            .ToList();   

sql
SELECT
  [o].[Id] AS [Id],
  [cus].[Name] AS [CustomName]
FROM
  [Order] o
  Left JOIN [Custom] cus ON ([o].[CustomId] = [cus].[Id])
  Left JOIN [OrderDetail] oritem ON ([o].[Id] = [oritem].[OrderId])
  Left JOIN [OrderDetail] oritem2 ON ([o].[Id] = [oritem2].[OrderId])
WHERE
  ([o].[Id] = @Id0)
 
   Feature2 :Include Query、Insert、Delete and Update
cs

//Includes
var list=db.Queryable()
           .Includes(x = x.Provinces,x=x.Citys ,x=x.Street) //multi-level
           .Includes(x = x.ClassInfo) 
           .ToList();

//Includes+left join        
var list5= db.Queryable()
           .Includes(x = x.school_001, x = x.rooms)
           .Includes(x = x.books)
           .LeftJoin((x, y) = x.Id==y.sid)
           .Select((x,y) = new Student_004DTO
           {
               SchoolId = x.SchoolId,
               books 

Top issues

Latest release

5.1.4.187 5.1.4.187 2025-03-29
5.1.4.187
增加 DbType.Custom 外部扩展库对bulkCopy的集成支持
DB2数据库相关功能完善
Xugu数据库相关功能完善
达梦数据库LONG自增在迁移第二次执行报错
人大金仓对新版本数据库的适配
sqlite数据库分表查询.netframework下表不存在报错
db.Queryable(queryable)在仓储中使用参数重名问题
优化 TDengine数据库性能,可以去掉EntityService中的通用转换
修复gbase 8s数据库迁移不能创建索引

5.1.4.185
CodeFirst 默认值列对老数据功能的优化
针对人大金仓PartitionByValue优化
mysql json函数对最新版本库的兼容
支持DB2数据库
IsCorrectErrorSqlParameterName 配置一些兼容问题

5.1.4.182
人大金仓最新版本数据库 mysql模式的兼容

5.1.4.180
人大金仓新版本数据库兼容
添加TDengine支持Tag动态建表 (文档已更新)
修复json2sql bug
导航查询一对一支持 默认值 SchoolA { get; set; }= new OneToOneInitializer();

5.1.4.178
.NET9最新SDK C14兼容性问题 i

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON