Update .net core project

This commit is contained in:
sunkaixuan 2022-06-17 14:48:34 +08:00
parent 08d33fe8aa
commit 5c32ae7e94
4 changed files with 11 additions and 7 deletions

View File

@ -15,7 +15,7 @@ namespace SqlSugar
} }
public virtual List<DbTableInfo> GetViewInfoList(bool isCache = true) public virtual List<DbTableInfo> GetViewInfoList(bool isCache = true)
{ {
string cacheKey = "DbMaintenanceProvider.GetViewInfoList"; string cacheKey = "DbMaintenanceProvider.GetViewInfoList" + this.Context.CurrentConnectionConfig.ConfigId;
cacheKey = GetCacheKey(cacheKey); cacheKey = GetCacheKey(cacheKey);
var result = new List<DbTableInfo>(); var result = new List<DbTableInfo>();
if (isCache) if (isCache)
@ -30,7 +30,7 @@ namespace SqlSugar
} }
public virtual List<DbTableInfo> GetTableInfoList(bool isCache = true) public virtual List<DbTableInfo> GetTableInfoList(bool isCache = true)
{ {
string cacheKey = "DbMaintenanceProvider.GetTableInfoList"; string cacheKey = "DbMaintenanceProvider.GetTableInfoList"+this.Context.CurrentConnectionConfig.ConfigId;
cacheKey = GetCacheKey(cacheKey); cacheKey = GetCacheKey(cacheKey);
var result = new List<DbTableInfo>(); var result = new List<DbTableInfo>();
if (isCache) if (isCache)
@ -46,7 +46,7 @@ namespace SqlSugar
public virtual List<DbColumnInfo> GetColumnInfosByTableName(string tableName, bool isCache = true) public virtual List<DbColumnInfo> GetColumnInfosByTableName(string tableName, bool isCache = true)
{ {
if (string.IsNullOrEmpty(tableName)) return new List<DbColumnInfo>(); if (string.IsNullOrEmpty(tableName)) return new List<DbColumnInfo>();
string cacheKey = "DbMaintenanceProvider.GetColumnInfosByTableName." + this.SqlBuilder.GetNoTranslationColumnName(tableName).ToLower(); string cacheKey = "DbMaintenanceProvider.GetColumnInfosByTableName." + this.SqlBuilder.GetNoTranslationColumnName(tableName).ToLower() + this.Context.CurrentConnectionConfig.ConfigId;
cacheKey = GetCacheKey(cacheKey); cacheKey = GetCacheKey(cacheKey);
var sql = string.Format(this.GetColumnInfosByTableNameSql, tableName); var sql = string.Format(this.GetColumnInfosByTableNameSql, tableName);
if (isCache) if (isCache)
@ -57,7 +57,7 @@ namespace SqlSugar
} }
public virtual List<string> GetIsIdentities(string tableName) public virtual List<string> GetIsIdentities(string tableName)
{ {
string cacheKey = "DbMaintenanceProvider.GetIsIdentities" + this.SqlBuilder.GetNoTranslationColumnName(tableName).ToLower(); string cacheKey = "DbMaintenanceProvider.GetIsIdentities" + this.SqlBuilder.GetNoTranslationColumnName(tableName).ToLower() + this.Context.CurrentConnectionConfig.ConfigId;
cacheKey = GetCacheKey(cacheKey); cacheKey = GetCacheKey(cacheKey);
return this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey, () => return this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey, () =>
{ {
@ -67,7 +67,7 @@ namespace SqlSugar
} }
public virtual List<string> GetPrimaries(string tableName) public virtual List<string> GetPrimaries(string tableName)
{ {
string cacheKey = "DbMaintenanceProvider.GetPrimaries" + this.SqlBuilder.GetNoTranslationColumnName(tableName).ToLower(); string cacheKey = "DbMaintenanceProvider.GetPrimaries" + this.SqlBuilder.GetNoTranslationColumnName(tableName).ToLower() + this.Context.CurrentConnectionConfig.ConfigId;
cacheKey = GetCacheKey(cacheKey); cacheKey = GetCacheKey(cacheKey);
return this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey, () => return this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey, () =>
{ {

View File

@ -2422,7 +2422,7 @@ namespace SqlSugar
if (this.QueryBuilder.AsTables != null && this.QueryBuilder.AsTables.Count==1) if (this.QueryBuilder.AsTables != null && this.QueryBuilder.AsTables.Count==1)
{ {
var tableinfo = this.QueryBuilder.AsTables.First(); var tableinfo = this.QueryBuilder.AsTables.First();
if (this.Context.CurrentConnectionConfig?.MoreSettings?.IsWithNoLockQuery == true) if (this.Context.CurrentConnectionConfig?.MoreSettings?.IsWithNoLockQuery == true&& this.QueryBuilder.AsTables.First().Value.ObjToString().Contains(SqlWith.NoLock) ==false)
{ {
this.QueryBuilder.AsTables[tableinfo.Key] = " (SELECT * FROM " + this.QueryBuilder.AsTables.First().Value + $" {SqlWith.NoLock} )"; this.QueryBuilder.AsTables[tableinfo.Key] = " (SELECT * FROM " + this.QueryBuilder.AsTables.First().Value + $" {SqlWith.NoLock} )";
} }

View File

@ -381,6 +381,9 @@ namespace SqlSugar
case DbType.PostgreSQL: case DbType.PostgreSQL:
DependencyManagement.TryPostgreSQL(); DependencyManagement.TryPostgreSQL();
break; break;
case DbType.OpenGauss:
Check.ExceptionEasy("Use DbType.PostgreSQL , ConnectionString add No Reset On Close=true", "OpenGausso数据库可以使用DbType.PostgreSQL 并且连接字符串加上 No Reset On Close=true");
break;
case DbType.Kdbndp: case DbType.Kdbndp:
DependencyManagement.TryKdbndb(); DependencyManagement.TryKdbndb();
break; break;

View File

@ -17,6 +17,7 @@ namespace SqlSugar
Oscar, Oscar,
MySqlConnector, MySqlConnector,
Access, Access,
Custom=900 OpenGauss,
Custom =900
} }
} }