Skip to content
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
1 change: 1 addition & 0 deletions src/containers/Tenant/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"actions.createTable": "Create table...",
"actions.createExternalTable": "Create external table...",
"actions.createTopic": "Create topic...",
"actions.createColumnTable": "Create column table...",
"actions.createView": "Create view...",
"actions.dropTable": "Drop table...",
"actions.dropTopic": "Drop topic...",
Expand Down
12 changes: 12 additions & 0 deletions src/containers/Tenant/utils/queryTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ WITH (
-- if some keys are missing in a table when making multiple single queries by the primary key.
)`;
};
export const createColumnTableTemplate = (path: string) => {
return `-- docs: https://ydb.tech/en/docs/yql/reference/syntax/create_table#olap-tables
CREATE TABLE \`${path}/ydb_column_table\` (
id Int64 NOT NULL,
author Text,
title Text,
body Text,
PRIMARY KEY (id)
)
PARTITION BY HASH(id)
WITH (STORE = COLUMN)`;
};
export const alterTableTemplate = (path: string) => {
return `ALTER TABLE \`${path}\`
ADD COLUMN is_deleted Bool;`;
Expand Down
3 changes: 3 additions & 0 deletions src/containers/Tenant/utils/schemaActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import i18n from '../i18n';
import {
alterTableTemplate,
alterTopicTemplate,
createColumnTableTemplate,
createExternalTableTemplate,
createTableTemplate,
createTopicTemplate,
Expand Down Expand Up @@ -47,6 +48,7 @@ const bindActions = (

return {
createTable: inputQuery(createTableTemplate, 'script'),
createColumnTable: inputQuery(createColumnTableTemplate, 'script'),
alterTable: inputQuery(alterTableTemplate, 'script'),
selectQuery: inputQuery(selectQueryTemplate),
upsertQuery: inputQuery(upsertQueryTemplate),
Expand Down Expand Up @@ -89,6 +91,7 @@ export const getActions =
[copyItem],
[
{text: i18n('actions.createTable'), action: actions.createTable},
{text: i18n('actions.createColumnTable'), action: actions.createColumnTable},
{text: i18n('actions.createTopic'), action: actions.createTopic},
{text: i18n('actions.createView'), action: actions.createView},
],
Expand Down