SqlSugar is an open-source .NET ORM offering code-first and db-first workflows across dozens of relational and analytical databases.
Overview
SqlSugar is a long-maintained .NET ORM emphasizing concise APIs for query, insert, update, delete, navigation graphs, and dynamic low-code scenarios. It targets modern .NET versions alongside .NET Framework and advertises AOT compatibility.
One codebase can switch among many providers—SQL Server, MySQL, PostgreSQL, SQLite, Oracle, ClickHouse, MongoDB, domestic Chinese databases, cloud offerings, and custom adapters—by changing DbType settings.
Feature areas include multi-tenant SaaS patterns, automatic sharding, bulk operations, json-to-SQL helpers, repository and unit-of-work modes, filters, and rich navigation insert or update APIs without requiring database foreign keys.
Official Chinese documentation on donet5.com covers installation, migrations, performance tuning, and database-specific quirks. The project is MIT-licensed with active community forums.
Key features
- Multi-database DbType switching
- Navigation graph CRUD APIs
- Code-first and web-first modes
- Automatic table sharding
- Bulk read and write helpers
- Multi-tenant data isolation
- Json to SQL utilities
- AOT and Aspire support notes
Use cases
- Cross-database .NET products
- High-volume insert pipelines
- SaaS tenant partitioning
- Fluent query-style ORM syntax