Skip to content

Commit

Permalink
feat(flinksql): collect comment, type attribute for entity (DTStack#319)
Browse files Browse the repository at this point in the history
* feat(flinksql): collect comment, type attribute for entity

* feat(flinksql): delete console log

* fix(DTStack#305): delete function ctxToWord,using ctxToText instead of ctxToWord

* feat: update attribute's type

* feat(flinksql): update flinksql's entitycollect unit test

* feat: optimize interface and update unit test

* feat: update collect attr detail

* feat: optimize interface and some function's arguments

* feat: add comment and update params' name

* feat: collect alias in select statement

* feat: update collect attribute function and update unit test

---------

Co-authored-by: zhaoge <>
  • Loading branch information
Cythia828 authored and zhaoge committed Aug 2, 2024
1 parent 46da6ec commit ba5d30d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
12 changes: 8 additions & 4 deletions test/parser/mysql/contextCollect/entityCollector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ import fs from 'fs';
import path from 'path';
import { MySqlParserListener } from 'src/lib/mysql/MySqlParserListener';
import {
isCommonEntityContext,
isFuncEntityContext,
StmtContextType,
isCommonEntityContext,
isFuncEntityContext,
StmtContextType,
} from 'src/parser/common/entityCollector';
import { EntityContextType } from 'src/parser/common/types';
import { MySQL, MySqlEntityCollector, MysqlSplitListener } from 'src/parser/mysql';
import {
MySQL,
MySqlEntityCollector,
MysqlSplitListener,
} from 'src/parser/mysql';

const commonSql = fs.readFileSync(path.join(__dirname, 'fixtures', 'common.sql'), 'utf-8');

Expand Down
16 changes: 9 additions & 7 deletions test/parser/postgresql/contextCollect/entityCollector.test.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import { ParseTreeListener } from 'antlr4ng';
import fs from 'fs';
import path from 'path';
import { PostgreSqlParserListener } from 'src/lib/postgresql/PostgreSqlParserListener';
import {
isCommonEntityContext,
isFuncEntityContext,
StmtContextType,
PostgreSqlParserListener,
} from 'src/lib/postgresql/PostgreSqlParserListener';
import {
isCommonEntityContext,
isFuncEntityContext,
StmtContextType,
} from 'src/parser/common/entityCollector';
import { EntityContextType } from 'src/parser/common/types';
import {
PostgreSQL,
PostgreSqlEntityCollector,
PostgreSqlSplitListener,
PostgreSQL,
PostgreSqlEntityCollector,
PostgreSqlSplitListener,
} from 'src/parser/postgresql';

const commonSql = fs.readFileSync(path.join(__dirname, 'fixtures', 'common.sql'), 'utf-8');
Expand Down

0 comments on commit ba5d30d

Please sign in to comment.