feat: orm-cj 仓颉版 EF Core 风格 ORM 初始版本

- 基于数据模型(POCO + 注解)的映射与增删改查:DbContext/DbSet/ChangeTracker/QueryBuilder
- ISqlDialect 方言接口 + PostgreSQL/openGauss 实现,零外部依赖
- @DbContext 宏:纯声明 DbSet 类自动展开为完整 DbContext 子类
- 迁移:Migration/Migrator/ModelSnapshot(快照 JSON)/MiniJson,从模型生成迁移
- 迁移 CLI:add/rm/update/downgrade/list/help,应用内嵌一行 db.cli(args) 接入
- DbContext 便捷方法:databaseExists/hasPendingMigrations/migrate
- 57 个单元测试全部通过
This commit is contained in:
2026-08-19 09:14:01 +08:00
commit afa6096ed2
28 changed files with 5822 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
[package]
cjc-version = "1.1.3"
name = "orm"
organization = "simcu"
description = "SimApi 数据访问层 ORM(对齐 .NET EF Core:数据模型映射 + 增删改查 + 数据库迁移;多方言架构,内置 openGauss/PostgreSQL 方言)"
version = "1.0.0"
target-dir = ""
output-type = "static"
[target]
[target.x86_64-w64-mingw32]
compile-option = "-Woff unused --diagnostic-format=noColor -Woff deprecated"
[target.x86_64-w64-mingw32.bin-dependencies]
path-option = [ "${CANGJIE_STDX_PATH}" ]
[target.x86_64-unknown-linux-gnu]
compile-option = "-Woff unused --diagnostic-format=noColor -Woff deprecated"
[target.x86_64-unknown-linux-gnu.bin-dependencies]
path-option = [ "${CANGJIE_STDX_PATH}" ]
[target.aarch64-unknown-linux-gnu]
compile-option = "-Woff unused --diagnostic-format=noColor -Woff deprecated"
[target.aarch64-unknown-linux-gnu.bin-dependencies]
path-option = [ "${CANGJIE_STDX_PATH}" ]