mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-17 05:29:33 +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)
|
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, () =>
|
||||||
{
|
{
|
||||||
|
@ -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} )";
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
@ -17,6 +17,7 @@ namespace SqlSugar
|
|||||||
Oscar,
|
Oscar,
|
||||||
MySqlConnector,
|
MySqlConnector,
|
||||||
Access,
|
Access,
|
||||||
|
OpenGauss,
|
||||||
Custom =900
|
Custom =900
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user