This commit is contained in:
Kijin-Seija 2024-05-28 11:32:37 +08:00
commit 77a29dfb40

View File

@ -73,20 +73,22 @@ select_target_alias: [
## Alias
Some node names in dt-sql-parser code are different from its 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.
Some node names in dt-sql-parser code are different from their antlr4's definition.
Example:
![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
```typescript
const myPlugin = new DtSqlParserSemAnalysePlugin({
preprocessor: [
(sql) => sql.toUpperCase()
(sql) => sql.toUpperCase(),
...
]
})
```