Skip to content

Commit

Permalink
feat:增加可以根据PROJECT_ID获取数据库分片信息的接口 TencentBlueKing#6186
Browse files Browse the repository at this point in the history
  • Loading branch information
yjieliang committed Mar 2, 2022
1 parent 1c3bda6 commit 2a95c20
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,16 @@ class DataSourceDao {
}
}

fun getDataBasePiecewiseById(dslContext: DSLContext, projectId: String, moduleCode: String, clusterName: String): TDataSourceRecord? {
fun getDataBasePiecewiseById(dslContext: DSLContext,
projectId: String,
moduleCode: String,
clusterName: String
): TDataSourceRecord? {
val tr = TShardingRoutingRule.T_SHARDING_ROUTING_RULE
val routingRule = dslContext.select(tr.ROUTING_RULE).from(tr).where(tr.ROUTING_NAME.eq(projectId)).fetchOne()
val routingRule = dslContext.select(tr.ROUTING_RULE)
.from(tr)
.where(tr.ROUTING_NAME.eq(projectId))
.fetchOne()
if (routingRule != null && routingRule[0] != null) {
with(TDataSource.T_DATA_SOURCE) {
return dslContext.selectFrom(this)
Expand Down

0 comments on commit 2a95c20

Please sign in to comment.