Browse Source

Synchronization code

pull/33/head
sunkaixuan 2 years ago
parent
commit
5f673e5e22
  1. 10
      Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs
  2. 4
      Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLBuilder.cs

10
Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs

@ -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;
}

4
Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLBuilder.cs

@ -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("\".\""))
{

Loading…
Cancel
Save