mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-25 18:29:13 +08:00
Synchronization code
This commit is contained in:
@@ -440,7 +440,10 @@ namespace SqlSugar
|
||||
DependencyManagement.TryPostgreSQL();
|
||||
break;
|
||||
case DbType.OpenGauss:
|
||||
config.DbType = DbType.PostgreSQL;
|
||||
config.DbType = DbType.PostgreSQL;
|
||||
if (this.CurrentConnectionConfig.MoreSettings == null)
|
||||
this.CurrentConnectionConfig.MoreSettings = new ConnMoreSettings();
|
||||
this.CurrentConnectionConfig.MoreSettings.DatabaseModel = DbType.OpenGauss;
|
||||
break;
|
||||
case DbType.HG:
|
||||
InstanceFactory.CustomDllName = SugarCompatible.IsFramework ? throw new Exception("Only.NET CORE is supported") : "SqlSugar.HGCore";
|
||||
@@ -489,7 +492,10 @@ namespace SqlSugar
|
||||
InstanceFactory.CustomDllName = SugarCompatible.IsFramework ? "SqlSugar.OceanBaseForOracle" : "SqlSugar.OceanBaseForOracleCore";
|
||||
break;
|
||||
case DbType.GaussDB:
|
||||
config.DbType = DbType.PostgreSQL;
|
||||
config.DbType = DbType.PostgreSQL;
|
||||
if (this.CurrentConnectionConfig.MoreSettings == null)
|
||||
this.CurrentConnectionConfig.MoreSettings = new ConnMoreSettings();
|
||||
this.CurrentConnectionConfig.MoreSettings.DatabaseModel = DbType.GaussDB;
|
||||
break;
|
||||
case DbType.Vastbase:
|
||||
config.DbType = DbType.PostgreSQL;
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace SqlSugar
|
||||
public Expression Expression { get; set; }
|
||||
public Expression BaseExpression { get; set; }
|
||||
public List<SugarParameter> Parameters { get; set; }
|
||||
public ExpressionContext Conext { get; set; }
|
||||
}
|
||||
|
||||
public class MethodCallExpressionArgs
|
||||
|
||||
@@ -662,7 +662,8 @@ namespace SqlSugar
|
||||
return this.Context.DbMehtods.HasNumber(model);
|
||||
case "HasValue":
|
||||
return this.Context.DbMehtods.HasValue(model);
|
||||
case "IsNullOrEmpty":
|
||||
case "IsNullOrEmpty":
|
||||
model.Conext = this.Context;
|
||||
return this.Context.DbMehtods.IsNullOrEmpty(model);
|
||||
case "ToLower":
|
||||
return this.Context.DbMehtods.ToLower(model);
|
||||
|
||||
@@ -373,6 +373,20 @@ namespace SqlSugar
|
||||
var parameter = model.Args[0];
|
||||
return string.Format(" LENGTH({0})", parameter.MemberName);
|
||||
}
|
||||
public override string IsNullOrEmpty(MethodCallExpressionModel model)
|
||||
{
|
||||
if (model.Conext?.SugarContext?.Context?.CurrentConnectionConfig?.MoreSettings?.DatabaseModel == DbType.OpenGauss ||
|
||||
model.Conext?.SugarContext?.Context?.CurrentConnectionConfig?.MoreSettings?.DatabaseModel == DbType.Vastbase||
|
||||
model.Conext?.SugarContext?.Context?.CurrentConnectionConfig?.MoreSettings?.DatabaseModel == DbType.GaussDB)
|
||||
{
|
||||
var parameter = model.Args[0];
|
||||
return string.Format("( {0} IS NULL )", parameter.MemberName);
|
||||
}
|
||||
else
|
||||
{
|
||||
return base.IsNullOrEmpty(model);
|
||||
}
|
||||
}
|
||||
public override string MergeString(params string[] strings)
|
||||
{
|
||||
var key = Guid.NewGuid() + "";
|
||||
|
||||
Reference in New Issue
Block a user