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 ## 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(),
...
]
}) })
``` ```