From 7863b847c5725a8e637dfadb44eb3ed97b9e96ee Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 6 Dec 2025 09:57:25 +0000 Subject: [PATCH 1/4] Initial plan From 0eccb16c355c7b1a65d99e117b32ac91e20fb737 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 6 Dec 2025 10:03:03 +0000 Subject: [PATCH 2/4] Add read-only replicas template for column tables Co-authored-by: antonkovalenko <692649+antonkovalenko@users.noreply.github.com> --- src/containers/Tenant/i18n/en.json | 1 + src/containers/Tenant/utils/schemaActions.tsx | 19 ++++++++++++++++++- .../Tenant/utils/schemaQueryTemplates.ts | 12 ++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/containers/Tenant/i18n/en.json b/src/containers/Tenant/i18n/en.json index 5241e1f774..98af6e8a12 100644 --- a/src/containers/Tenant/i18n/en.json +++ b/src/containers/Tenant/i18n/en.json @@ -43,6 +43,7 @@ "actions.alterTable": "Alter table...", "actions.manageColumns": "Manage columns...", "actions.manageAutoPartitioning": "Manage auto partitioning...", + "actions.manageReadReplicas": "Add read-only replicas...", "actions.addTableIndex": "Add index...", "actions.addVectorIndex": "Add vector index...", "actions.createCdcStream": "Create changefeed...", diff --git a/src/containers/Tenant/utils/schemaActions.tsx b/src/containers/Tenant/utils/schemaActions.tsx index 77faa5ccf5..644bbdcd99 100644 --- a/src/containers/Tenant/utils/schemaActions.tsx +++ b/src/containers/Tenant/utils/schemaActions.tsx @@ -47,6 +47,7 @@ import { dropTransferTemplate, dropViewTemplate, manageAutoPartitioningTemplate, + manageReadReplicasTemplate, selectQueryTemplate, showCreateTableTemplate, upsertQueryTemplate, @@ -137,6 +138,7 @@ const bindActions = ( alterTable: inputQuery(alterTableTemplate), dropTable: inputQuery(dropTableTemplate), manageAutoPartitioning: inputQuery(manageAutoPartitioningTemplate), + manageReadReplicas: inputQuery(manageReadReplicasTemplate), selectQuery: inputQuery(selectQueryTemplate), showCreateTable: inputQuery(showCreateTableTemplate), upsertQuery: inputQuery(upsertQueryTemplate), @@ -259,6 +261,21 @@ export const getActions = ], }; + const alterColumnTableGroupItem = { + text: i18n('actions.alterTable'), + items: [ + {text: i18n('actions.manageColumns'), action: actions.alterTable}, + { + text: i18n('actions.manageAutoPartitioning'), + action: actions.manageAutoPartitioning, + }, + { + text: i18n('actions.manageReadReplicas'), + action: actions.manageReadReplicas, + }, + ], + }; + let DB_SET: ActionsSet = [[copyItem, connectToDBItem], createEntitiesSet]; const DIR_SET: ActionsSet = [[copyItem], createEntitiesSet]; @@ -309,7 +326,7 @@ export const getActions = const COLUMN_TABLE_SET: ActionsSet = [ [copyItem], [ - alterTableGroupItem, + alterColumnTableGroupItem, {text: i18n('actions.dropTable'), action: actions.dropTable}, {text: i18n('actions.selectQuery'), action: actions.selectQuery}, {text: i18n('actions.upsertQuery'), action: actions.upsertQuery}, diff --git a/src/containers/Tenant/utils/schemaQueryTemplates.ts b/src/containers/Tenant/utils/schemaQueryTemplates.ts index f9005ce79a..180c918f5a 100644 --- a/src/containers/Tenant/utils/schemaQueryTemplates.ts +++ b/src/containers/Tenant/utils/schemaQueryTemplates.ts @@ -143,6 +143,18 @@ ALTER TABLE ${path} SET AUTO_PARTITIONING_MAX_PARTITIONS_COUNT = 100 -- Partitions are split only if their number doesn't exceed the value specified by this parameter. )`; }; + +export const manageReadReplicasTemplate = (params?: SchemaQueryParams) => { + const path = params?.relativePath + ? `\`${normalizeParameter(params.relativePath)}\`` + : '${1:}'; + + return `ALTER TABLE ${path} SET +( + READ_REPLICAS_SETTINGS = 'PER_AZ:1'-- Enable read replicas for stale read, launch one replica in every availability zone. docs: https://clck.ru/3Qh8iQ +)`; +}; + export const selectQueryTemplate = (params?: SchemaQueryParams) => { const path = params?.relativePath ? `\`${normalizeParameter(params.relativePath)}\`` From 962ee4e63259853675d42b8c392ba43fd1409854 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 6 Dec 2025 10:05:14 +0000 Subject: [PATCH 3/4] Fix formatting: add space before comment in read replicas template Co-authored-by: antonkovalenko <692649+antonkovalenko@users.noreply.github.com> --- src/containers/Tenant/utils/schemaQueryTemplates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/Tenant/utils/schemaQueryTemplates.ts b/src/containers/Tenant/utils/schemaQueryTemplates.ts index 180c918f5a..a52f145f77 100644 --- a/src/containers/Tenant/utils/schemaQueryTemplates.ts +++ b/src/containers/Tenant/utils/schemaQueryTemplates.ts @@ -151,7 +151,7 @@ export const manageReadReplicasTemplate = (params?: SchemaQueryParams) => { return `ALTER TABLE ${path} SET ( - READ_REPLICAS_SETTINGS = 'PER_AZ:1'-- Enable read replicas for stale read, launch one replica in every availability zone. docs: https://clck.ru/3Qh8iQ + READ_REPLICAS_SETTINGS = 'PER_AZ:1' -- Enable read replicas for stale read, launch one replica in every availability zone. docs: https://clck.ru/3Qh8iQ )`; }; From 7496368bb8ddc1fcd29a66782c09a3378854ce03 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 6 Dec 2025 16:13:32 +0000 Subject: [PATCH 4/4] Fix: move read replicas action to row tables instead of column tables Co-authored-by: antonkovalenko <692649+antonkovalenko@users.noreply.github.com> --- src/containers/Tenant/utils/schemaActions.tsx | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/containers/Tenant/utils/schemaActions.tsx b/src/containers/Tenant/utils/schemaActions.tsx index 644bbdcd99..808b4164e7 100644 --- a/src/containers/Tenant/utils/schemaActions.tsx +++ b/src/containers/Tenant/utils/schemaActions.tsx @@ -251,17 +251,6 @@ export const getActions = ]; const alterTableGroupItem = { - text: i18n('actions.alterTable'), - items: [ - {text: i18n('actions.manageColumns'), action: actions.alterTable}, - { - text: i18n('actions.manageAutoPartitioning'), - action: actions.manageAutoPartitioning, - }, - ], - }; - - const alterColumnTableGroupItem = { text: i18n('actions.alterTable'), items: [ {text: i18n('actions.manageColumns'), action: actions.alterTable}, @@ -326,7 +315,7 @@ export const getActions = const COLUMN_TABLE_SET: ActionsSet = [ [copyItem], [ - alterColumnTableGroupItem, + alterTableGroupItem, {text: i18n('actions.dropTable'), action: actions.dropTable}, {text: i18n('actions.selectQuery'), action: actions.selectQuery}, {text: i18n('actions.upsertQuery'), action: actions.upsertQuery},