Merge branch 'master' of https://github.com/Kijin-Seija/dt-sql-parser-semantic-analyse-plugin
This commit is contained in:
commit
77a29dfb40
10
README.md
10
README.md
@ -73,20 +73,22 @@ select_target_alias: [
|
|||||||
|
|
||||||
## Alias
|
## Alias
|
||||||
|
|
||||||
Some node names in dt-sql-parser code are different from its antlr4's definition.
|
Some node names in dt-sql-parser code are different from their antlr4's definition.
|
||||||
|
|
||||||
You can find possible alias in https://github.com/DTStack/dt-sql-parser/blob/main/src/grammar/postgresql/PostgreSqlParser.g4, then add it into `alias` option.
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
![alt text](./assets/alias-example.png)
|
![alt text](./assets/alias-example.png)
|
||||||
|
|
||||||
|
You can find possible alias in https://github.com/DTStack/dt-sql-parser/blob/main/src/grammar/postgresql/PostgreSqlParser.g4, then add it into `alias` option.
|
||||||
|
|
||||||
## Add a preprocessor
|
## Add a preprocessor
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
const myPlugin = new DtSqlParserSemAnalysePlugin({
|
const myPlugin = new DtSqlParserSemAnalysePlugin({
|
||||||
preprocessor: [
|
preprocessor: [
|
||||||
(sql) => sql.toUpperCase()
|
(sql) => sql.toUpperCase(),
|
||||||
|
...
|
||||||
|
]
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user