mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-06-28 13:34:32 +08:00
DbLink support
This commit is contained in:
parent
7889c4b781
commit
b1a1c3f487
@ -1188,6 +1188,11 @@ 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())
|
||||
{
|
||||
tableName = dbLinkName+"."+this.QueryBuilder.Builder.GetTranslationColumnName(tableName);
|
||||
}
|
||||
return tableName;
|
||||
}
|
||||
protected string AppendSelect(List<EntityColumnInfo> entityColumnInfos,string sql, ReadOnlyCollection<ParameterExpression> parameters, List<EntityColumnInfo> columnsResult, int parameterIndex1)
|
||||
|
@ -23,6 +23,10 @@ namespace SqlSugar
|
||||
/// </summary>
|
||||
public string ConnectionString { get; set; }
|
||||
/// <summary>
|
||||
/// QueryableWithAttr queries go to DbLinkName, which is commonly used for cross-library queries
|
||||
/// </summary>
|
||||
public string DbLinkName { get; set; }
|
||||
/// <summary>
|
||||
/// true does not need to close the connection
|
||||
/// </summary>
|
||||
public bool IsAutoCloseConnection { get; set; }
|
||||
|
@ -237,6 +237,7 @@ namespace SqlSugar
|
||||
},
|
||||
ConnectionString = it.ConnectionString,
|
||||
DbType = it.DbType,
|
||||
DbLinkName= it.DbLinkName,
|
||||
IndexSuffix = it.IndexSuffix,
|
||||
InitKeyType = it.InitKeyType,
|
||||
IsAutoCloseConnection = it.IsAutoCloseConnection,
|
||||
|
Loading…
Reference in New Issue
Block a user