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