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 Fixes. #985

Closed BurakCinar07 closed 2 years ago

BurakCinar07 commented 2 years ago

Changes mostly focused on audit feature.

DotNetNext commented 2 years ago

Npgsql version update the reason for the change is older version there is an unimplemented method which throws exception.

Can you specifically

BurakCinar07 commented 2 years ago

Insert operations throws MissingMethodException when I use Npgsql 4.1.3.1 version. Details:

An unhandled exception has occurred while executing the request. System.MissingMethodException: Method not found: 'Npgsql.NpgsqlDataReader Npgsql.NpgsqlCommand.ExecuteReader()'. at SqlSugar.AdoProvider.GetDataSetAll(String sql, SugarParameter[] parameters) in D:\repos\SqlSugar\Src\Asp.NetCore2\SqlSeverTest\SqlSugar\Abstract\AdoProvider\AdoProvider.cs:line 421 at SqlSugar.AdoProvider.GetDataTable(String sql, SugarParameter[] parameters) in D:\repos\SqlSugar\Src\Asp.NetCore2\SqlSeverTest\SqlSugar\Abstract\AdoProvider\AdoProvider.cs:line 1080 at SqlSugar.QueryableProvider1.ToDataTable() in D:\repos\SqlSugar\Src\Asp.NetCore2\SqlSeverTest\SqlSugar\Abstract\QueryableProvider\QueryableProvider.cs:line 1167 at SqlSugar.InsertableProvider1.GetDiffTableBySql(Nullable1 identity) in D:\repos\SqlSugar\Src\Asp.NetCore2\SqlSeverTest\SqlSugar\Abstract\InsertableProvider\InsertableProvider.cs:line 867 at SqlSugar.InsertableProvider1.GetDiffTable(String sql, Nullable1 identity) in D:\repos\SqlSugar\Src\Asp.NetCore2\SqlSeverTest\SqlSugar\Abstract\InsertableProvider\InsertableProvider.cs:line 794 at SqlSugar.InsertableProvider1.After(String sql, Nullable1 result) in D:\repos\SqlSugar\Src\Asp.NetCore2\SqlSeverTest\SqlSugar\Abstract\InsertableProvider\InsertableProvider.cs:line 759 at SqlSugar.PostgreSQLInserttable1.ExecuteReturnIdentityAsync() in D:\repos\SqlSugar\Src\Asp.NetCore2\SqlSeverTest\SqlSugar\Realization\PostgreSQL\Insertable\PostgreSQLInserttable.cs:line 30

DotNetNext commented 2 years ago

Have a DEMO?

BurakCinar07 commented 2 years ago

The exception was caused by another library that uses Npgsql version 6.0.2 version.

To reproduce error Npgsql.EntityFrameworkCore.PostgreSQL package can be added to project and changing Npgsql version at SqlSugar.csproj to 4.1.3.1. Insert query also needs to have EnableDiffLogEvent.

I sent you a demo via email.

DotNetNext commented 2 years ago

Npgsql can be installed independently in Nuget , sqlsugar The built-in ones don't need to be upgraded

DotNetNext commented 2 years ago

You can reference sqlsugar. DLL and nuget to install Npgsql Version 6.0.2 version