Skip to content

Commit

Permalink
feat: update snippet label
Browse files Browse the repository at this point in the history
  • Loading branch information
jialan committed Nov 26, 2024
1 parent cba61b3 commit fdbb7cc
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 78 deletions.
14 changes: 7 additions & 7 deletions src/languages/flink/flink.snippet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { CompletionSnippetOption } from 'src/monaco.contribution';

export const flinkSnippets: CompletionSnippetOption[] = [
{
label: 'create source table',
label: 'create-source-table',
prefix: 'CREATE-SOURCE-TABLE',
body: [
'CREATE TABLE ${1:source_table} (',
Expand All @@ -20,7 +20,7 @@ export const flinkSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'create sink table',
label: 'create-sink-table',
prefix: 'CREATE-SINK-TABLE',
body: [
'CREATE TABLE ${1:sink_table} (',
Expand All @@ -36,7 +36,7 @@ export const flinkSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'tumble window',
label: 'tumble-window',
prefix: 'TUMBLE-WINDOW',
body: [
'SELECT',
Expand All @@ -53,7 +53,7 @@ export const flinkSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'hop window',
label: 'hop-window',
prefix: 'HOP-WINDOW',
body: [
'SELECT',
Expand All @@ -71,7 +71,7 @@ export const flinkSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'comulate window',
label: 'comulate-window',
prefix: 'CUMULATE-WINDOW',
body: [
'SELECT',
Expand All @@ -89,7 +89,7 @@ export const flinkSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'session window',
label: 'session-window',
prefix: 'SESSION-WINDOW',
body: [
'SELECT',
Expand All @@ -103,7 +103,7 @@ export const flinkSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'insert into',
label: 'insert-into-select',
prefix: 'INSERT-INTO-SELECT',
body: [
'INSERT INTO ${1:table_name}',
Expand Down
24 changes: 12 additions & 12 deletions src/languages/hive/hive.snippet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ export const hiveSnippets: CompletionSnippetOption[] = [
body: ['SELECT ${2:column1}, ${3:column2} FROM ${1:table_name};\n$4']
},
{
label: 'select join',
label: 'select-join',
prefix: 'SELECT-JOIN',
body: [
'SELECT ${8:column1} FROM ${1:table_name} ${2:t1}',
'${3:LEFT} JOIN ${4:table2} ${5:t2} ON ${2:t1}.${6:column1} = ${5:t2}.${7:column2};\n$9'
]
},
{
label: 'select order-by',
label: 'select-order-by',
prefix: 'SELECT-ORDERBY',
body: [
'SELECT ${2:column1}, ${3:column2} FROM ${1:table_name} ORDER BY ${4:column1} ${5:desc};\n$6'
Expand All @@ -29,7 +29,7 @@ export const hiveSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'insert into select',
label: 'insert-into-select',
prefix: 'INSERT-INTO-SELECT',
body: [
'INSERT INTO TABLE ${1:table_name}',
Expand All @@ -39,8 +39,8 @@ export const hiveSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'insert overwrite table',
prefix: 'INSERT-OVERWRITE',
label: 'insert-overwrite-table',
prefix: 'INSERT-OVERWRITE-TABLE',
body: [
'INSERT OVERWRITE TABLE ${1:table_name}',
'SELECT ${3:column1}, ${4:column2}',
Expand All @@ -63,7 +63,7 @@ export const hiveSnippets: CompletionSnippetOption[] = [
body: ['DELETE FROM ${1:table_name}', 'WHERE ${2:column1} = ${3:value1};\n$4']
},
{
label: 'create table',
label: 'create-table',
prefix: 'CREATE-TABLE',
body: [
'CREATE TABLE IF NOT EXISTS ${1:table_name} (',
Expand All @@ -77,7 +77,7 @@ export const hiveSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'create table as select',
label: 'create-table-as-select',
prefix: 'CREATE-TABLE-AS-SELECT',
body: [
'CREATE TABLE IF NOT EXISTS ${1:table_name}',
Expand All @@ -88,7 +88,7 @@ export const hiveSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'create partition table',
label: 'create-partition-table',
prefix: 'CREATE-PARTITION-TABLE',
body: [
'CREATE TABLE IF NOT EXISTS ${1:table_name} (',
Expand All @@ -103,7 +103,7 @@ export const hiveSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'create bucket table',
label: 'create-bucket-table',
prefix: 'CREATE-BUCKET-TABLE',
body: [
'CREATE TABLE IF NOT EXISTS ${1:table_name} (',
Expand All @@ -119,21 +119,21 @@ export const hiveSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'alter table partition',
label: 'alter-table-partition',
prefix: 'ALTER-TABLE-PARTITION',
body: [
"ALTER TABLE ${1:table_name} ${2:ADD} PARTITION (${3:part_column}='${4:part_value}');\n$5"
]
},
{
label: 'alter table properties',
label: 'alter-table-properties',
prefix: 'ALTER-TABLE-PROPERTIES',
body: [
"ALTER TABLE ${1:table_name} SET TBLPROPERTIES ('${2:property_name}'='${3:property_value}');\n$4"
]
},
{
label: 'alter table columns',
label: 'alter-table-columns',
prefix: 'ALTER-TABLE-COLUMNS',
body: [
'ALTER TABLE ${1:table_name} ADD COLUMNS (',
Expand Down
22 changes: 11 additions & 11 deletions src/languages/impala/impala.snippet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ export const impalaSnippets: CompletionSnippetOption[] = [
body: ['SELECT ${2:column1}, ${3:column2} FROM ${1:table_name};\n$4']
},
{
label: 'select join',
label: 'select-join',
prefix: 'SELECT-JOIN',
body: [
'SELECT ${8:column1} FROM ${1:table_name} ${2:t1}',
'${3:LEFT} JOIN ${4:table2} ${5:t2} ON ${2:t1}.${6:column1} = ${5:t2}.${7:column2};\n$9'
]
},
{
label: 'select order-by',
label: 'select-order-by',
prefix: 'SELECT-ORDER-BY',
body: [
'SELECT ${2:column1}, ${3:column2} FROM ${1:table_name} ORDER BY ${4:column1} ${5:desc};\n$6'
Expand All @@ -29,7 +29,7 @@ export const impalaSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'insert into select',
label: 'insert-into-select',
prefix: 'INSERT-INTO-SELECT',
body: [
'INSERT INTO ${1:table_name}',
Expand All @@ -39,8 +39,8 @@ export const impalaSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'insert overwrite table',
prefix: 'INSERT-OVERWRITE',
label: 'insert-overwrite-table',
prefix: 'INSERT-OVERWRITE-TABLE',
body: [
'INSERT OVERWRITE TABLE ${1:table_name}',
'SELECT ${3:column1}, ${4:column2}',
Expand All @@ -63,7 +63,7 @@ export const impalaSnippets: CompletionSnippetOption[] = [
body: ['DELETE FROM ${1:table_name}', 'WHERE ${2:column1} = ${3:value1};\n$4']
},
{
label: 'create table',
label: 'create-table',
prefix: 'CREATE-TABLE',
body: [
'CREATE TABLE IF NOT EXISTS ${1:table_name} (',
Expand All @@ -75,7 +75,7 @@ export const impalaSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'create table as select',
label: 'create-table-as-select',
prefix: 'CREATE-TABLE-AS-SELECT',
body: [
'CREATE TABLE IF NOT EXISTS ${1:table_name}',
Expand All @@ -86,7 +86,7 @@ export const impalaSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'create partition table',
label: 'create-partition-table',
prefix: 'CREATE-PARTITION-TABLE',
body: [
'CREATE TABLE IF NOT EXISTS ${1:table_name} (',
Expand All @@ -99,21 +99,21 @@ export const impalaSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'alter table partition',
label: 'alter-table-partition',
prefix: 'ALTER-TABLE-PARTITION',
body: [
"ALTER TABLE ${1:table_name} ${2:ADD} PARTITION (${3:part_column} = '${4:part_value}');\n$5"
]
},
{
label: 'alter table properties',
label: 'alter-table-properties',
prefix: 'ALTER-TABLE-PROPERTIES',
body: [
"ALTER TABLE ${1:table_name} SET TBLPROPERTIES ('${2:property_name}' = '${3:property_value}');\n$4"
]
},
{
label: 'alter table column',
label: 'alter-table-column',
prefix: 'ALTER-TABLE-COLUMN',
body: [
"ALTER TABLE ${1:table_name} ADD COLUMN ${2:column_name} ${3:STRING} COMMENT '${4:desc}';\n$5"
Expand Down
30 changes: 15 additions & 15 deletions src/languages/mysql/mysql.snippet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ export const mysqlSnippets: CompletionSnippetOption[] = [
body: ['SELECT ${2:column1}, ${3:column2} FROM ${1:table_name};\n$4']
},
{
label: 'select join',
label: 'select-join',
prefix: 'SELECT-JOIN',
body: [
'SELECT ${8:column1} FROM ${1:table_name} ${2:t1}',
'${3:LEFT} JOIN ${4:table2} ${5:t2} ON ${2:t1}.${6:column1} = ${5:t2}.${7:column2};\n$9'
]
},
{
label: 'select order-by',
label: 'select-order-by',
prefix: 'SELECT-ORDER-BY',
body: [
'SELECT ${2:column1}, ${3:column2} FROM ${1:table_name} ORDER BY ${4:column1} ${5:desc};\n$6'
Expand All @@ -29,7 +29,7 @@ export const mysqlSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'insert into select',
label: 'insert-into-select',
prefix: 'INSERT-INTO-SELECT',
body: [
'INSERT INTO ${1:table_name}',
Expand All @@ -39,7 +39,7 @@ export const mysqlSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'replace into table',
label: 'replace-into-table',
prefix: 'REPLACE-INTO-TABLE',
body: [
'REPLACE INTO ${1:table_name} (${2:column1}, ${3:column2})',
Expand All @@ -61,7 +61,7 @@ export const mysqlSnippets: CompletionSnippetOption[] = [
body: ['DELETE FROM ${1:table_name}', 'WHERE ${2:column1} = ${3:value1};\n$4']
},
{
label: 'create table',
label: 'create-table',
prefix: 'CREATE-TABLE',
body: [
'CREATE TABLE ${1:table_name} (',
Expand All @@ -73,7 +73,7 @@ export const mysqlSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'create table as select',
label: 'create-table-as-select',
prefix: 'CREATE-TABLE-AS-SELECT',
body: [
'CREATE TABLE ${1:table_name}',
Expand All @@ -84,7 +84,7 @@ export const mysqlSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'create table partitioned by range',
label: 'create-table-partitioned-by-range',
prefix: 'CREATE-TABLE-PARTITIONED-BY-RANGE',
body: [
'CREATE TABLE ${1:table_name} (',
Expand All @@ -98,7 +98,7 @@ export const mysqlSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'create table partitioned by list',
label: 'create-table-partitioned-by-list',
prefix: 'CREATE-TABLE-PARTITIONED-BY-LIST',
body: [
'CREATE TABLE ${1:table_name} (',
Expand All @@ -112,7 +112,7 @@ export const mysqlSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'create table partitioned by hash',
label: 'create-table-partitioned-by-hash',
prefix: 'CREATE-TABLE-PARTITIONED-BY-HASH',
body: [
'CREATE TABLE ${1:table_name} (',
Expand All @@ -125,7 +125,7 @@ export const mysqlSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'create table partitioned by key',
label: 'create-table-partitioned-by-key',
prefix: 'CREATE-TABLE-PARTITIONED-BY-KEY',
body: [
'CREATE TABLE ${1:table_name} (',
Expand All @@ -138,27 +138,27 @@ export const mysqlSnippets: CompletionSnippetOption[] = [
]
},
{
label: 'alter table add column',
label: 'alter-table-add-column',
prefix: 'ALTER-TABLE-ADD-COLUMN',
body: ["ALTER TABLE ${1:table_name} ADD ${2:column_name} ${3:INT} COMMENT '${4:desc}';\n$5"]
},
{
label: 'alter table add partition',
label: 'alter-table-add-partition',
prefix: 'ALTER-TABLE-ADD-PARTITION',
body: ['ALTER TABLE ${1:table_name} ADD PARTITION (', '\t$2', ');\n$4']
},
{
label: 'alter table add index',
label: 'alter-table-add-index',
prefix: 'ALTER-TABLE-ADD-INDEX',
body: ['ALTER TABLE ${1:table_name} ADD INDEX ${2:index_name} (${3:column_name});\n$4']
},
{
label: 'alter table add primary key',
label: 'alter-table-add-primary-key',
prefix: 'ALTER-TABLE-ADD-PRIMARY-KEY',
body: ['ALTER TABLE ${1:table_name} ADD PRIMARY KEY (${2:column_name});\n$3']
},
{
label: 'alter table add constraint',
label: 'alter-table-add-constraint',
prefix: 'ALTER-TABLE-ADD-CONSTRAINT',
body: [
'ALTER TABLE ${1:table_name}',
Expand Down
Loading

0 comments on commit fdbb7cc

Please sign in to comment.