Browse Source

Synchronization code

pull/38/MERGE
sunkaixuan 1 year ago
parent
commit
0d64e56562
  1. 2
      Src/Asp.NetCore2/SqlSugar/Infrastructure/StaticConfig.cs
  2. 9
      Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/PostgreSQLProvider.cs

2
Src/Asp.NetCore2/SqlSugar/Infrastructure/StaticConfig.cs

@ -9,6 +9,8 @@ namespace SqlSugar
{
public static Func<string,string> Encode { get; set; }
public static Func<string,string> Decode{ get; set; }
public static bool AppContext_ConvertInfinityDateTime { get; set; }
public const string CodeFirst_BigString = "varcharmax,longtext,text,clob";
public static Func<long> CustomSnowFlakeFunc;

9
Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/PostgreSQLProvider.cs

@ -14,9 +14,12 @@ namespace SqlSugar
{
public PostgreSQLProvider()
{
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
if (StaticConfig.AppContext_ConvertInfinityDateTime == false)
{
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
}
}
public override IDbConnection Connection

Loading…
Cancel
Save