mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-15 20:49:31 +08:00
Update .net core project
This commit is contained in:
parent
08d33fe8aa
commit
5c32ae7e94
@ -15,7 +15,7 @@ namespace SqlSugar
|
||||
}
|
||||
public virtual List<DbTableInfo> GetViewInfoList(bool isCache = true)
|
||||
{
|
||||
string cacheKey = "DbMaintenanceProvider.GetViewInfoList";
|
||||
string cacheKey = "DbMaintenanceProvider.GetViewInfoList" + this.Context.CurrentConnectionConfig.ConfigId;
|
||||
cacheKey = GetCacheKey(cacheKey);
|
||||
var result = new List<DbTableInfo>();
|
||||
if (isCache)
|
||||
@ -30,7 +30,7 @@ namespace SqlSugar
|
||||
}
|
||||
public virtual List<DbTableInfo> GetTableInfoList(bool isCache = true)
|
||||
{
|
||||
string cacheKey = "DbMaintenanceProvider.GetTableInfoList";
|
||||
string cacheKey = "DbMaintenanceProvider.GetTableInfoList"+this.Context.CurrentConnectionConfig.ConfigId;
|
||||
cacheKey = GetCacheKey(cacheKey);
|
||||
var result = new List<DbTableInfo>();
|
||||
if (isCache)
|
||||
@ -46,7 +46,7 @@ namespace SqlSugar
|
||||
public virtual List<DbColumnInfo> GetColumnInfosByTableName(string tableName, bool isCache = true)
|
||||
{
|
||||
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);
|
||||
var sql = string.Format(this.GetColumnInfosByTableNameSql, tableName);
|
||||
if (isCache)
|
||||
@ -57,7 +57,7 @@ namespace SqlSugar
|
||||
}
|
||||
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);
|
||||
return this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey, () =>
|
||||
{
|
||||
@ -67,7 +67,7 @@ namespace SqlSugar
|
||||
}
|
||||
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);
|
||||
return this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey, () =>
|
||||
{
|
||||
|
@ -2422,7 +2422,7 @@ namespace SqlSugar
|
||||
if (this.QueryBuilder.AsTables != null && this.QueryBuilder.AsTables.Count==1)
|
||||
{
|
||||
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} )";
|
||||
}
|
||||
|
@ -381,6 +381,9 @@ namespace SqlSugar
|
||||
case DbType.PostgreSQL:
|
||||
DependencyManagement.TryPostgreSQL();
|
||||
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:
|
||||
DependencyManagement.TryKdbndb();
|
||||
break;
|
||||
|
@ -17,6 +17,7 @@ namespace SqlSugar
|
||||
Oscar,
|
||||
MySqlConnector,
|
||||
Access,
|
||||
Custom=900
|
||||
OpenGauss,
|
||||
Custom =900
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user