Skip to content

feat: add/drop table index template #1456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/containers/Tenant/Query/NewSQL/NewSQL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ export function NewSQL() {
text: i18n('action.drop-external-table'),
action: actions.dropExternalTable,
},
{
text: i18n('action.add-index'),
action: actions.addTableIndex,
},
{
text: i18n('action.drop-index'),
action: actions.dropTableIndex,
},
],
},
{
Expand Down
2 changes: 2 additions & 0 deletions src/containers/Tenant/Query/NewSQL/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"action.select-from-external-table": "Select from external table",
"action.delete-rows": "Delete rows",
"action.drop-table": "Drop table",
"action.add-index": "Add index",
"action.drop-index": "Drop index",
"action.drop-external-table": "Drop external table",
"menu.tables": "Tables",
"menu.topics": "Topics",
Expand Down
2 changes: 2 additions & 0 deletions src/containers/Tenant/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"actions.copied": "The path is copied to the clipboard",
"actions.notCopied": "Couldn’t copy the path",
"actions.copyPath": "Copy path",
"actions.dropIndex": "Drop index",
"actions.openPreview": "Open preview",
"actions.createTable": "Create table...",
"actions.createExternalTable": "Create external table...",
Expand All @@ -36,6 +37,7 @@
"actions.dropTopic": "Drop topic...",
"actions.dropView": "Drop view...",
"actions.alterTable": "Alter table...",
"actions.addTableIndex": "Add index...",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we want to add action "Drop index..." directly to index entity?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added INDEX_SET

"actions.alterTopic": "Alter topic...",
"actions.selectQuery": "Select query...",
"actions.upsertQuery": "Upsert query...",
Expand Down
6 changes: 5 additions & 1 deletion src/containers/Tenant/utils/newSQLQueryActions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {changeUserInput} from '../../../store/reducers/executeQuery';

import {
addTableIndex,
alterAsyncReplicationTemplate,
alterTableTemplate,
alterTopicTemplate,
Expand All @@ -17,6 +18,7 @@ import {
dropAsyncReplicationTemplate,
dropExternalTableTemplate,
dropGroupTemplate,
dropTableIndex,
dropTableTemplate,
dropTopicTemplate,
dropUserTemplate,
Expand All @@ -25,7 +27,7 @@ import {
selectQueryTemplate,
updateTableTemplate,
upsertQueryTemplate,
} from './newSQLQueryTemplates';
} from './schemaQueryTemplates';

export const bindActions = (dispatch: React.Dispatch<any>) => {
const inputQuery = (query: () => string) => () => {
Expand Down Expand Up @@ -58,5 +60,7 @@ export const bindActions = (dispatch: React.Dispatch<any>) => {
revokePrivilege: inputQuery(revokePrivilegeTemplate),
dropUser: inputQuery(dropUserTemplate),
dropGroup: inputQuery(dropGroupTemplate),
addTableIndex: inputQuery(addTableIndex),
dropTableIndex: inputQuery(dropTableIndex),
};
};
250 changes: 0 additions & 250 deletions src/containers/Tenant/utils/newSQLQueryTemplates.ts

This file was deleted.

Loading
Loading