@lark-apaas/miaoda-cli 0.1.19-beta.6a5cefe → 0.1.20-alpha.504be27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -70,6 +70,7 @@ exports.SQL_KEYWORDS = [
70
70
  // DDL
71
71
  'CREATE',
72
72
  'ALTER',
73
+ 'ENABLE',
73
74
  'DROP',
74
75
  'TRUNCATE',
75
76
  'RENAME',
@@ -411,6 +411,19 @@ const ISO_TIMESTAMP_RE = /^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?
411
411
  const SYNTAX_RE = /syntax error at or near "([^"]+)"/i;
412
412
  const RELATION_RE = /relation "([^"]+)" does not exist/i;
413
413
  const COLUMN_RE = /column "([^"]+)"(?: of relation "([^"]+)")? does not exist/i;
414
+ const KEYWORD_TYPO_IGNORE_WORDS = new Set([
415
+ // Legal PostgreSQL terms that are not useful keyword typo candidates.
416
+ 'ROW',
417
+ 'LEVEL',
418
+ 'SECURITY',
419
+ // Common index access methods used after `USING`.
420
+ 'BTREE',
421
+ 'HASH',
422
+ 'GIST',
423
+ 'SPGIST',
424
+ 'GIN',
425
+ 'BRIN',
426
+ ]);
414
427
  /**
415
428
  * 在错误抛出前富化 next_actions(最多 1 条 hint),按 PG 报错形态分发:
416
429
  *
@@ -540,6 +553,8 @@ function findKeywordTypo(sql) {
540
553
  const upper = tok.toUpperCase();
541
554
  if (sql_keywords_1.SQL_KEYWORDS.includes(upper))
542
555
  continue; // 写对的关键字
556
+ if (KEYWORD_TYPO_IGNORE_WORDS.has(upper))
557
+ continue;
543
558
  const guess = (0, fuzzy_match_1.suggest)(upper, sql_keywords_1.SQL_KEYWORDS);
544
559
  if (guess && guess !== upper) {
545
560
  return { input: tok, suggest: guess };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/miaoda-cli",
3
- "version": "0.1.19-beta.6a5cefe",
3
+ "version": "0.1.20-alpha.504be27",
4
4
  "description": "Miaoda 平台命令行工具,面向 Agent 调用",
5
5
  "type": "commonjs",
6
6
  "bin": {