DotNetNext / SqlSugar

.Net aot ORM Fastest ORM Simple Easy VB.NET Sqlite orm Oracle ORM Mysql Orm 虚谷数据库 postgresql ORm SqlServer oRm 达梦 ORM 人大金仓 ORM 神通ORM C# ORM , C# ORM .NET ORM NET5 ORM .NET6 ORM ClickHouse orm QuestDb ,TDengine ORM,OceanBase orm,GaussDB orm ,Tidb orm Object/Relational Mapping
https://www.donet5.com/Home/Doc
MIT License
5.35k stars 1.34k forks source link

postgresql只要执行返回跟id相关的方法,都会以小写id去查询返回,并不会按照设置了PgSqlIsAutoToLower = false使用Id进行查询 #953

Closed pigwing closed 3 years ago

pigwing commented 3 years ago

ExecuteReturnBigIdentityAsync 等方法,postgresql设置了PgSqlIsAutoToLower = false不自动小写,但是Id依然会产生id小写.

pigwing commented 3 years ago

image

DotNetNext commented 3 years ago

上代码 和实体

DotNetNext commented 3 years ago

不规范表,我只能作兼容处理,已知的情况可以发给我

pigwing commented 3 years ago

public class MyEntity { [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "Id")] public long Id { get; set; } public string A {get;set} }

SqlSugarClient.Insertable(entityObj).ExecuteReturnBigIdentityAsync()

pigwing commented 3 years ago

@donet5 针对postgresql的情况,默认是区分大小写的.然后也配置了PgSqlIsAutoToLower = false,其他都没问题,就是需要插入并且返回自增长的Id的时候,把Id直接小写成了id,导致postgresql报id字段不存在,应该是要用Id这个字段的.

DotNetNext commented 3 years ago

本地已解决 周一前会同步