Commit 57add7b6e7939642ad3bd4240cbaf0c9af324ec6
Committed by
Gitee
1 parent
fb6771aa
feat: sql/tools 错误信息输出到 stderr
Signed-off-by: dhb52 <dhb52@126.com>
Showing
1 changed file
with
4 additions
and
1 deletions
sql/tools/convertor.py
| @@ -17,6 +17,7 @@ uv run --with simple-ddl-parser convertor.py dm8 > ../dm/ruoyi-vue-pro-dm8.sql | @@ -17,6 +17,7 @@ uv run --with simple-ddl-parser convertor.py dm8 > ../dm/ruoyi-vue-pro-dm8.sql | ||
| 17 | import argparse | 17 | import argparse |
| 18 | import pathlib | 18 | import pathlib |
| 19 | import re | 19 | import re |
| 20 | +import sys | ||
| 20 | import time | 21 | import time |
| 21 | from abc import ABC, abstractmethod | 22 | from abc import ABC, abstractmethod |
| 22 | from typing import Dict, Generator, Optional, Tuple, Union | 23 | from typing import Dict, Generator, Optional, Tuple, Union |
| @@ -293,8 +294,10 @@ class Convertor(ABC): | @@ -293,8 +294,10 @@ class Convertor(ABC): | ||
| 293 | 294 | ||
| 294 | # 将parse失败的脚本打印出来 | 295 | # 将parse失败的脚本打印出来 |
| 295 | if error_scripts: | 296 | if error_scripts: |
| 297 | + print("!!! 以下内容无法正常解析", file=sys.stderr) | ||
| 296 | for script in error_scripts: | 298 | for script in error_scripts: |
| 297 | - print(script) | 299 | + # print to stderr |
| 300 | + print(script, file=sys.stderr) | ||
| 298 | 301 | ||
| 299 | 302 | ||
| 300 | class PostgreSQLConvertor(Convertor): | 303 | class PostgreSQLConvertor(Convertor): |