Update pgsql

This commit is contained in:
sunkaixuan 2023-05-12 20:41:23 +08:00
parent a96d708297
commit 163dd64dd0
2 changed files with 11 additions and 3 deletions

View File

@ -1198,10 +1198,14 @@ namespace SqlSugar
tableName = this.QueryBuilder.LambdaExpressions.DbMehtods.GetTableWithDataBase
(this.QueryBuilder.Builder.GetTranslationColumnName(dbName), this.QueryBuilder.Builder.GetTranslationColumnName(tableName));
}
var dbLinkName = this.Context.CurrentConnectionConfig.DbLinkName;
if (dbLinkName.HasValue())
if (attr != null && configId != attr.configId.ObjToString())
{
tableName = dbLinkName+"."+this.QueryBuilder.Builder.GetTranslationColumnName(oldTableName);
var dbLinkName = this.Context.Root.GetConnection(attr.configId).CurrentConnectionConfig.DbLinkName;
if (dbLinkName != null)
{
tableName = dbLinkName + "." + this.QueryBuilder.Builder.GetTranslationColumnName(oldTableName);
}
}
return tableName;
}

View File

@ -80,6 +80,10 @@ namespace SqlSugar
var mappingInfo = context
.MappingTables
.FirstOrDefault(it => it.EntityName.Equals(name, StringComparison.CurrentCultureIgnoreCase));
if (mappingInfo == null && name.Contains(".") && name.Contains("\""))
{
return name;
}
name = (mappingInfo == null ? name : mappingInfo.DbTableName);
if (name.Contains(".")&& !name.Contains("(")&&!name.Contains("\".\""))
{