mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-12-02 03:13:58 +08:00
Synchronization code
This commit is contained in:
@@ -14,6 +14,7 @@ namespace SqlSugar
|
|||||||
public bool DisableMillisecond { get; set; }
|
public bool DisableMillisecond { get; set; }
|
||||||
public bool PgSqlIsAutoToLower = true;
|
public bool PgSqlIsAutoToLower = true;
|
||||||
public bool PgSqlIsAutoToLowerCodeFirst = true;
|
public bool PgSqlIsAutoToLowerCodeFirst = true;
|
||||||
|
public bool IsAutoToUpper = true;
|
||||||
public int DefaultCacheDurationInSeconds { get; set; }
|
public int DefaultCacheDurationInSeconds { get; set; }
|
||||||
public bool? TableEnumIsString { get; set; }
|
public bool? TableEnumIsString { get; set; }
|
||||||
public DateTime? DbMinDate { get; set; } = Convert.ToDateTime("1900-01-01");
|
public DateTime? DbMinDate { get; set; } = Convert.ToDateTime("1900-01-01");
|
||||||
|
|||||||
@@ -314,14 +314,14 @@ namespace SqlSugar
|
|||||||
if (item.ColumnDescription != null)
|
if (item.ColumnDescription != null)
|
||||||
{
|
{
|
||||||
//column remak
|
//column remak
|
||||||
if (db.DbMaintenance.IsAnyColumnRemark(item.DbColumnName.ToUpper(), item.DbTableName.ToUpper()))
|
if (db.DbMaintenance.IsAnyColumnRemark(item.DbColumnName.ToUpper(IsUppper), item.DbTableName.ToUpper(IsUppper)))
|
||||||
{
|
{
|
||||||
db.DbMaintenance.DeleteColumnRemark(item.DbColumnName.ToUpper(), item.DbTableName.ToUpper());
|
db.DbMaintenance.DeleteColumnRemark(item.DbColumnName.ToUpper(IsUppper), item.DbTableName.ToUpper(IsUppper));
|
||||||
db.DbMaintenance.AddColumnRemark(item.DbColumnName.ToUpper(), item.DbTableName.ToUpper(), item.ColumnDescription);
|
db.DbMaintenance.AddColumnRemark(item.DbColumnName.ToUpper(IsUppper), item.DbTableName.ToUpper(IsUppper), item.ColumnDescription);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
db.DbMaintenance.AddColumnRemark(item.DbColumnName.ToUpper(), item.DbTableName.ToUpper(), item.ColumnDescription);
|
db.DbMaintenance.AddColumnRemark(item.DbColumnName.ToUpper(IsUppper), item.DbTableName.ToUpper(IsUppper), item.ColumnDescription);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -398,7 +398,7 @@ namespace SqlSugar
|
|||||||
this.Context.Ado.IsEnableLogEvent = false;
|
this.Context.Ado.IsEnableLogEvent = false;
|
||||||
string sql = @" select distinct cu.COLUMN_name KEYNAME from user_cons_columns cu, user_constraints au
|
string sql = @" select distinct cu.COLUMN_name KEYNAME from user_cons_columns cu, user_constraints au
|
||||||
where cu.constraint_name = au.constraint_name
|
where cu.constraint_name = au.constraint_name
|
||||||
and au.constraint_type = 'P' and au.table_name = '" + tableName.ToUpper() + @"'";
|
and au.constraint_type = 'P' and au.table_name = '" + tableName.ToUpper(IsUppper) + @"'";
|
||||||
var pks = this.Context.Ado.SqlQuery<string>(sql);
|
var pks = this.Context.Ado.SqlQuery<string>(sql);
|
||||||
this.Context.Ado.IsEnableLogEvent = oldIsEnableLog;
|
this.Context.Ado.IsEnableLogEvent = oldIsEnableLog;
|
||||||
return pks;
|
return pks;
|
||||||
@@ -414,7 +414,7 @@ namespace SqlSugar
|
|||||||
string sql = "SELECT COMMENTS FROM USER_TAB_COMMENTS WHERE TABLE_NAME =@tableName ORDER BY TABLE_NAME";
|
string sql = "SELECT COMMENTS FROM USER_TAB_COMMENTS WHERE TABLE_NAME =@tableName ORDER BY TABLE_NAME";
|
||||||
var oldIsEnableLog = this.Context.Ado.IsEnableLogEvent;
|
var oldIsEnableLog = this.Context.Ado.IsEnableLogEvent;
|
||||||
this.Context.Ado.IsEnableLogEvent = false;
|
this.Context.Ado.IsEnableLogEvent = false;
|
||||||
var pks = this.Context.Ado.SqlQuery<string>(sql, new { tableName = tableName.ToUpper() });
|
var pks = this.Context.Ado.SqlQuery<string>(sql, new { tableName = tableName.ToUpper(IsUppper) });
|
||||||
this.Context.Ado.IsEnableLogEvent = oldIsEnableLog;
|
this.Context.Ado.IsEnableLogEvent = oldIsEnableLog;
|
||||||
return pks;
|
return pks;
|
||||||
});
|
});
|
||||||
@@ -427,7 +427,7 @@ namespace SqlSugar
|
|||||||
var comments = this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey,
|
var comments = this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey,
|
||||||
() =>
|
() =>
|
||||||
{
|
{
|
||||||
string sql = "SELECT TVNAME AS TableName, COLNAME as DbColumnName ,COMMENT$ AS ColumnDescription from SYSCOLUMNCOMMENTS WHERE TVNAME='" + tableName.ToUpper() + "' ORDER BY TVNAME";
|
string sql = "SELECT TVNAME AS TableName, COLNAME as DbColumnName ,COMMENT$ AS ColumnDescription from SYSCOLUMNCOMMENTS WHERE TVNAME='" + tableName.ToUpper(IsUppper) + "' ORDER BY TVNAME";
|
||||||
var oldIsEnableLog = this.Context.Ado.IsEnableLogEvent;
|
var oldIsEnableLog = this.Context.Ado.IsEnableLogEvent;
|
||||||
this.Context.Ado.IsEnableLogEvent = false;
|
this.Context.Ado.IsEnableLogEvent = false;
|
||||||
var pks = this.Context.Ado.SqlQuery<DbColumnInfo>(sql);
|
var pks = this.Context.Ado.SqlQuery<DbColumnInfo>(sql);
|
||||||
@@ -462,7 +462,7 @@ namespace SqlSugar
|
|||||||
//string primaryKeyInfo = null;
|
//string primaryKeyInfo = null;
|
||||||
if (columns.Any(it => it.IsPrimarykey) && isCreatePrimaryKey)
|
if (columns.Any(it => it.IsPrimarykey) && isCreatePrimaryKey)
|
||||||
{
|
{
|
||||||
sql= sql.TrimEnd(')')+ string.Format(", Primary key({0})", string.Join(",", columns.Where(it => it.IsPrimarykey).Select(it => this.SqlBuilder.GetTranslationColumnName(it.DbColumnName.ToLower()))));
|
sql= sql.TrimEnd(')')+ string.Format(", Primary key({0})", string.Join(",", columns.Where(it => it.IsPrimarykey).Select(it => this.SqlBuilder.GetTranslationColumnName(it.DbColumnName.ToUpper(IsUppper)))));
|
||||||
sql = sql + ")";
|
sql = sql + ")";
|
||||||
}
|
}
|
||||||
//sql = sql.Replace("$PrimaryKey", primaryKeyInfo);
|
//sql = sql.Replace("$PrimaryKey", primaryKeyInfo);
|
||||||
@@ -470,5 +470,22 @@ namespace SqlSugar
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Helper
|
||||||
|
public bool IsUppper
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (this.Context.CurrentConnectionConfig.MoreSettings == null)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return this.Context.CurrentConnectionConfig.MoreSettings.IsAutoToUpper == true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -35,17 +35,31 @@ namespace SqlSugar
|
|||||||
if (result.Contains("(") && result.Contains(")"))
|
if (result.Contains("(") && result.Contains(")"))
|
||||||
return result;
|
return result;
|
||||||
else
|
else
|
||||||
return result.ToUpper();
|
return result.ToUpper(IsUppper);
|
||||||
}
|
}
|
||||||
public override string GetTranslationColumnName(string entityName, string propertyName)
|
public override string GetTranslationColumnName(string entityName, string propertyName)
|
||||||
{
|
{
|
||||||
var result = base.GetTranslationColumnName(entityName, propertyName);
|
var result = base.GetTranslationColumnName(entityName, propertyName);
|
||||||
return result.ToUpper();
|
return result.ToUpper(IsUppper);
|
||||||
}
|
}
|
||||||
public override string GetTranslationColumnName(string propertyName)
|
public override string GetTranslationColumnName(string propertyName)
|
||||||
{
|
{
|
||||||
var result = base.GetTranslationColumnName(propertyName);
|
var result = base.GetTranslationColumnName(propertyName);
|
||||||
return result.ToUpper();
|
return result.ToUpper(IsUppper);
|
||||||
|
}
|
||||||
|
public bool IsUppper
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (this.Context.CurrentConnectionConfig.MoreSettings == null)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return this.Context.CurrentConnectionConfig.MoreSettings.IsAutoToUpper == true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,15 +27,29 @@ namespace SqlSugar
|
|||||||
public override string SqlTranslationRight { get { return "\""; } }
|
public override string SqlTranslationRight { get { return "\""; } }
|
||||||
public override string GetTranslationTableName(string entityName, bool isMapping = true)
|
public override string GetTranslationTableName(string entityName, bool isMapping = true)
|
||||||
{
|
{
|
||||||
return base.GetTranslationTableName(entityName, isMapping).ToUpper();
|
return base.GetTranslationTableName(entityName, isMapping).ToUpper(IsUppper);
|
||||||
}
|
}
|
||||||
public override string GetTranslationColumnName(string columnName)
|
public override string GetTranslationColumnName(string columnName)
|
||||||
{
|
{
|
||||||
return base.GetTranslationColumnName(columnName).ToUpper();
|
return base.GetTranslationColumnName(columnName).ToUpper(IsUppper);
|
||||||
}
|
}
|
||||||
public override string GetDbColumnName(string entityName, string propertyName)
|
public override string GetDbColumnName(string entityName, string propertyName)
|
||||||
{
|
{
|
||||||
return base.GetDbColumnName(entityName, propertyName).ToUpper();
|
return base.GetDbColumnName(entityName, propertyName).ToUpper(IsUppper);
|
||||||
|
}
|
||||||
|
public bool IsUppper
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (this.SugarContext?.Context?.Context?.CurrentConnectionConfig?.MoreSettings==null)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return this.SugarContext?.Context?.Context?.CurrentConnectionConfig?.MoreSettings.IsAutoToUpper == true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public partial class DmMethod : DefaultDbMethod, IDbMethods
|
public partial class DmMethod : DefaultDbMethod, IDbMethods
|
||||||
|
|||||||
@@ -37,9 +37,22 @@ namespace SqlSugar
|
|||||||
|
|
||||||
private string GetOracleUpdateColums(int i, DbColumnInfo m)
|
private string GetOracleUpdateColums(int i, DbColumnInfo m)
|
||||||
{
|
{
|
||||||
return string.Format("\"{0}\"={1}", m.DbColumnName.ToUpper(), FormatValue(i, m.DbColumnName, m.Value));
|
return string.Format("\"{0}\"={1}", m.DbColumnName.ToUpper(IsUppper), FormatValue(i, m.DbColumnName, m.Value));
|
||||||
|
}
|
||||||
|
public bool IsUppper
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (this.Context.CurrentConnectionConfig.MoreSettings == null)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return this.Context.CurrentConnectionConfig.MoreSettings.IsAutoToUpper == true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public object FormatValue(int i, string name, object value)
|
public object FormatValue(int i, string name, object value)
|
||||||
{
|
{
|
||||||
if (value == null)
|
if (value == null)
|
||||||
|
|||||||
@@ -323,14 +323,14 @@ namespace SqlSugar
|
|||||||
if (item.ColumnDescription != null)
|
if (item.ColumnDescription != null)
|
||||||
{
|
{
|
||||||
//column remak
|
//column remak
|
||||||
if (db.DbMaintenance.IsAnyColumnRemark(item.DbColumnName.ToUpper(), item.DbTableName.ToUpper()))
|
if (db.DbMaintenance.IsAnyColumnRemark(item.DbColumnName.ToUpper(IsUppper), item.DbTableName.ToUpper(IsUppper)))
|
||||||
{
|
{
|
||||||
db.DbMaintenance.DeleteColumnRemark(this.SqlBuilder.GetTranslationColumnName(item.DbColumnName) , item.DbTableName.ToUpper());
|
db.DbMaintenance.DeleteColumnRemark(this.SqlBuilder.GetTranslationColumnName(item.DbColumnName) , item.DbTableName.ToUpper(IsUppper));
|
||||||
db.DbMaintenance.AddColumnRemark(this.SqlBuilder.GetTranslationColumnName(item.DbColumnName), item.DbTableName.ToUpper(), item.ColumnDescription);
|
db.DbMaintenance.AddColumnRemark(this.SqlBuilder.GetTranslationColumnName(item.DbColumnName), item.DbTableName.ToUpper(IsUppper), item.ColumnDescription);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
db.DbMaintenance.AddColumnRemark(item.DbColumnName.ToUpper(), item.DbTableName.ToUpper(), item.ColumnDescription);
|
db.DbMaintenance.AddColumnRemark(item.DbColumnName.ToUpper(IsUppper), item.DbTableName.ToUpper(IsUppper), item.ColumnDescription);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -462,7 +462,7 @@ namespace SqlSugar
|
|||||||
this.Context.Ado.IsEnableLogEvent = false;
|
this.Context.Ado.IsEnableLogEvent = false;
|
||||||
string sql = @" select distinct cu.COLUMN_name KEYNAME from user_cons_columns cu, user_constraints au
|
string sql = @" select distinct cu.COLUMN_name KEYNAME from user_cons_columns cu, user_constraints au
|
||||||
where cu.constraint_name = au.constraint_name
|
where cu.constraint_name = au.constraint_name
|
||||||
and au.constraint_type = 'P' and au.table_name = '" + tableName.ToUpper() + @"'";
|
and au.constraint_type = 'P' and au.table_name = '" + tableName.ToUpper(IsUppper) + @"'";
|
||||||
var pks = this.Context.Ado.SqlQuery<string>(sql);
|
var pks = this.Context.Ado.SqlQuery<string>(sql);
|
||||||
this.Context.Ado.IsEnableLogEvent = oldIsEnableLog;
|
this.Context.Ado.IsEnableLogEvent = oldIsEnableLog;
|
||||||
return pks;
|
return pks;
|
||||||
@@ -478,7 +478,7 @@ namespace SqlSugar
|
|||||||
string sql = "SELECT COMMENTS FROM USER_TAB_COMMENTS WHERE TABLE_NAME =@tableName ORDER BY TABLE_NAME";
|
string sql = "SELECT COMMENTS FROM USER_TAB_COMMENTS WHERE TABLE_NAME =@tableName ORDER BY TABLE_NAME";
|
||||||
var oldIsEnableLog = this.Context.Ado.IsEnableLogEvent;
|
var oldIsEnableLog = this.Context.Ado.IsEnableLogEvent;
|
||||||
this.Context.Ado.IsEnableLogEvent = false;
|
this.Context.Ado.IsEnableLogEvent = false;
|
||||||
var pks = this.Context.Ado.SqlQuery<string>(sql, new { tableName = tableName.ToUpper() });
|
var pks = this.Context.Ado.SqlQuery<string>(sql, new { tableName = tableName.ToUpper(IsUppper) });
|
||||||
this.Context.Ado.IsEnableLogEvent = oldIsEnableLog;
|
this.Context.Ado.IsEnableLogEvent = oldIsEnableLog;
|
||||||
return pks;
|
return pks;
|
||||||
});
|
});
|
||||||
@@ -494,7 +494,7 @@ namespace SqlSugar
|
|||||||
string sql = "SELECT TABLE_NAME AS TableName, COLUMN_NAME AS DbColumnName,COMMENTS AS ColumnDescription FROM user_col_comments WHERE TABLE_NAME =@tableName ORDER BY TABLE_NAME";
|
string sql = "SELECT TABLE_NAME AS TableName, COLUMN_NAME AS DbColumnName,COMMENTS AS ColumnDescription FROM user_col_comments WHERE TABLE_NAME =@tableName ORDER BY TABLE_NAME";
|
||||||
var oldIsEnableLog = this.Context.Ado.IsEnableLogEvent;
|
var oldIsEnableLog = this.Context.Ado.IsEnableLogEvent;
|
||||||
this.Context.Ado.IsEnableLogEvent = false;
|
this.Context.Ado.IsEnableLogEvent = false;
|
||||||
var pks = this.Context.Ado.SqlQuery<DbColumnInfo>(sql, new { tableName = tableName.ToUpper() });
|
var pks = this.Context.Ado.SqlQuery<DbColumnInfo>(sql, new { tableName = tableName.ToUpper(IsUppper) });
|
||||||
this.Context.Ado.IsEnableLogEvent = oldIsEnableLog;
|
this.Context.Ado.IsEnableLogEvent = oldIsEnableLog;
|
||||||
return pks;
|
return pks;
|
||||||
});
|
});
|
||||||
@@ -538,5 +538,22 @@ namespace SqlSugar
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Helper
|
||||||
|
public bool IsUppper
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (this.Context.CurrentConnectionConfig.MoreSettings == null)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return this.Context.CurrentConnectionConfig.MoreSettings.IsAutoToUpper == true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,17 +38,17 @@ namespace SqlSugar
|
|||||||
if (result.Contains("(") && result.Contains(")"))
|
if (result.Contains("(") && result.Contains(")"))
|
||||||
return result;
|
return result;
|
||||||
else
|
else
|
||||||
return result.ToUpper();
|
return result.ToUpper(IsUppper);
|
||||||
}
|
}
|
||||||
public override string GetTranslationColumnName(string entityName, string propertyName)
|
public override string GetTranslationColumnName(string entityName, string propertyName)
|
||||||
{
|
{
|
||||||
var result = base.GetTranslationColumnName(entityName, propertyName);
|
var result = base.GetTranslationColumnName(entityName, propertyName);
|
||||||
return result.ToUpper();
|
return result.ToUpper(IsUppper);
|
||||||
}
|
}
|
||||||
public override string GetTranslationColumnName(string propertyName)
|
public override string GetTranslationColumnName(string propertyName)
|
||||||
{
|
{
|
||||||
var result = base.GetTranslationColumnName(propertyName);
|
var result = base.GetTranslationColumnName(propertyName);
|
||||||
return result.ToUpper();
|
return result.ToUpper(IsUppper);
|
||||||
}
|
}
|
||||||
public override string RemoveParentheses(string sql)
|
public override string RemoveParentheses(string sql)
|
||||||
{
|
{
|
||||||
@@ -59,5 +59,21 @@ namespace SqlSugar
|
|||||||
|
|
||||||
return sql;
|
return sql;
|
||||||
}
|
}
|
||||||
|
#region Helper
|
||||||
|
public bool IsUppper
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (this.Context.CurrentConnectionConfig.MoreSettings == null)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return this.Context.CurrentConnectionConfig.MoreSettings.IsAutoToUpper == true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace SqlSugar
|
|||||||
public override string SqlTranslationRight { get { return "\""; } }
|
public override string SqlTranslationRight { get { return "\""; } }
|
||||||
public override string GetTranslationTableName(string entityName, bool isMapping = true)
|
public override string GetTranslationTableName(string entityName, bool isMapping = true)
|
||||||
{
|
{
|
||||||
return base.GetTranslationTableName(entityName, isMapping).ToUpper();
|
return base.GetTranslationTableName(entityName, isMapping).ToUpper(IsUppper);
|
||||||
}
|
}
|
||||||
public override string GetTranslationColumnName(string columnName)
|
public override string GetTranslationColumnName(string columnName)
|
||||||
{
|
{
|
||||||
@@ -39,11 +39,11 @@ namespace SqlSugar
|
|||||||
return columnName;
|
return columnName;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return base.GetTranslationColumnName(columnName).ToUpper();
|
return base.GetTranslationColumnName(columnName).ToUpper(IsUppper);
|
||||||
}
|
}
|
||||||
public override string GetDbColumnName(string entityName, string propertyName)
|
public override string GetDbColumnName(string entityName, string propertyName)
|
||||||
{
|
{
|
||||||
return base.GetDbColumnName(entityName,propertyName).ToUpper();
|
return base.GetDbColumnName(entityName,propertyName).ToUpper(IsUppper);
|
||||||
}
|
}
|
||||||
public override bool IsTranslationText(string name)
|
public override bool IsTranslationText(string name)
|
||||||
{
|
{
|
||||||
@@ -54,6 +54,20 @@ namespace SqlSugar
|
|||||||
var result = name.IsContainsIn(SqlTranslationLeft, SqlTranslationRight, UtilConstants.Space, ExpressionConst.LeftParenthesis, ExpressionConst.RightParenthesis);
|
var result = name.IsContainsIn(SqlTranslationLeft, SqlTranslationRight, UtilConstants.Space, ExpressionConst.LeftParenthesis, ExpressionConst.RightParenthesis);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
public bool IsUppper
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (this.SugarContext?.Context?.Context?.CurrentConnectionConfig?.MoreSettings == null)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return this.SugarContext?.Context?.Context?.CurrentConnectionConfig?.MoreSettings.IsAutoToUpper == true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public partial class OracleMethod : DefaultDbMethod, IDbMethods
|
public partial class OracleMethod : DefaultDbMethod, IDbMethods
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace SqlSugar
|
|||||||
|
|
||||||
private string GetOracleUpdateColums(DbColumnInfo m)
|
private string GetOracleUpdateColums(DbColumnInfo m)
|
||||||
{
|
{
|
||||||
return string.Format("\"{0}\"={1}", m.DbColumnName.ToUpper(), FormatValue(m.Value,m.IsPrimarykey,m.PropertyName));
|
return string.Format("\"{0}\"={1}", m.DbColumnName.ToUpper(IsUppper), FormatValue(m.Value,m.IsPrimarykey,m.PropertyName));
|
||||||
}
|
}
|
||||||
int i = 0;
|
int i = 0;
|
||||||
public object FormatValue(object value,bool isPrimaryKey,string name)
|
public object FormatValue(object value,bool isPrimaryKey,string name)
|
||||||
@@ -112,5 +112,22 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Helper
|
||||||
|
public bool IsUppper
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (this.Context.CurrentConnectionConfig.MoreSettings == null)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return this.Context.CurrentConnectionConfig.MoreSettings.IsAutoToUpper == true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
public PostgreSQLProvider()
|
public PostgreSQLProvider()
|
||||||
{
|
{
|
||||||
|
|
||||||
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
|
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
|
||||||
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
|
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
|
||||||
|
|
||||||
}
|
}
|
||||||
public override IDbConnection Connection
|
public override IDbConnection Connection
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -96,5 +96,11 @@ namespace SqlSugar
|
|||||||
if (isAutoToLower == false) return value;
|
if (isAutoToLower == false) return value;
|
||||||
return value.ToLower();
|
return value.ToLower();
|
||||||
}
|
}
|
||||||
|
internal static string ToUpper(this string value, bool isAutoToUpper)
|
||||||
|
{
|
||||||
|
if (value == null) return null;
|
||||||
|
if (isAutoToUpper == false) return value;
|
||||||
|
return value.ToUpper();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,7 +179,8 @@ namespace SqlSugar
|
|||||||
DisableMillisecond = it.MoreSettings.DisableMillisecond,
|
DisableMillisecond = it.MoreSettings.DisableMillisecond,
|
||||||
DbMinDate=it.MoreSettings.DbMinDate,
|
DbMinDate=it.MoreSettings.DbMinDate,
|
||||||
IsNoReadXmlDescription=it.MoreSettings.IsNoReadXmlDescription,
|
IsNoReadXmlDescription=it.MoreSettings.IsNoReadXmlDescription,
|
||||||
SqlServerCodeFirstNvarchar=it.MoreSettings.SqlServerCodeFirstNvarchar
|
SqlServerCodeFirstNvarchar=it.MoreSettings.SqlServerCodeFirstNvarchar,
|
||||||
|
IsAutoToUpper=it.MoreSettings.IsAutoToUpper
|
||||||
|
|
||||||
},
|
},
|
||||||
SqlMiddle = it.SqlMiddle == null ? null : new SqlMiddle
|
SqlMiddle = it.SqlMiddle == null ? null : new SqlMiddle
|
||||||
|
|||||||
Reference in New Issue
Block a user