mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-26 10:49:20 +08:00
Synchronization code
This commit is contained in:
@@ -441,6 +441,9 @@ namespace SqlSugar
|
||||
break;
|
||||
case DbType.OpenGauss:
|
||||
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";
|
||||
@@ -490,6 +493,9 @@ namespace SqlSugar
|
||||
break;
|
||||
case DbType.GaussDB:
|
||||
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
|
||||
|
||||
@@ -663,6 +663,7 @@ namespace SqlSugar
|
||||
case "HasValue":
|
||||
return this.Context.DbMehtods.HasValue(model);
|
||||
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