mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 02:14:53 +08:00
Add MoreSetting.OracleDisableNvarchar
This commit is contained in:
@@ -323,6 +323,15 @@ namespace SqlSugar
|
||||
#endregion
|
||||
|
||||
#region Private methods
|
||||
internal string GetN()
|
||||
{
|
||||
var N = "N";
|
||||
if (_Context.CurrentConnectionConfig.MoreSettings != null && _Context.CurrentConnectionConfig.MoreSettings.OracleDisableNvarchar)
|
||||
{
|
||||
N = "";
|
||||
}
|
||||
return N;
|
||||
}
|
||||
private static void CheckDbDependency(ConnectionConfig config)
|
||||
{
|
||||
switch (config.DbType)
|
||||
|
||||
@@ -10,9 +10,14 @@ namespace SqlSugar
|
||||
public bool IsAutoRemoveDataCache { get; set; }
|
||||
public bool IsWithNoLockQuery { get; set; }
|
||||
/// <summary>
|
||||
/// Some MYSQL databases do not support NVarchar set true
|
||||
/// Some MYSQL databases do not support Nvarchar set true
|
||||
/// </summary>
|
||||
public bool MySqlDisableNarvchar { get; set; }
|
||||
public bool MySqlDisableNvarchar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///Oracle nvarchar partial operation disabled
|
||||
/// </summary>
|
||||
public bool OracleDisableNvarchar { get; set; }
|
||||
public bool PgSqlIsAutoToLower = true;
|
||||
public int DefaultCacheDurationInSeconds { get; set; }
|
||||
}
|
||||
|
||||
@@ -107,6 +107,7 @@ namespace SqlSugar
|
||||
}
|
||||
else
|
||||
{
|
||||
string N = this.Context.GetN();
|
||||
var type = UtilMethods.GetUnderType(value.GetType());
|
||||
if (type == UtilConstants.StringType && value.ToString().Contains("{SugarSeq:=}"))
|
||||
{
|
||||
@@ -136,11 +137,11 @@ namespace SqlSugar
|
||||
}
|
||||
else if (type == UtilConstants.StringType || type == UtilConstants.ObjType)
|
||||
{
|
||||
return "N'" + value.ToString().ToSqlFilter() + "'";
|
||||
return N+"'" + value.ToString().ToSqlFilter() + "'";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "N'" + value.ToString() + "'";
|
||||
return N+"'" + value.ToString() + "'";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace SqlSugar
|
||||
}
|
||||
else
|
||||
{
|
||||
string N =this.Context.GetN();
|
||||
var type = UtilMethods.GetUnderType(value.GetType());
|
||||
if (type == UtilConstants.DateType)
|
||||
{
|
||||
@@ -69,11 +70,11 @@ namespace SqlSugar
|
||||
}
|
||||
else if (type == UtilConstants.StringType || type == UtilConstants.ObjType)
|
||||
{
|
||||
return "N'" + value.ToString().ToSqlFilter() + "'";
|
||||
return N + "'" + value.ToString().ToSqlFilter() + "'";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "N'" + value.ToString() + "'";
|
||||
return N + "'" + value.ToString() + "'";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user