Commit ee0d8589d56ca7350f17465c65ed07ba8944d84f
Committed by
Gitee
!1389 feat: sql/tools 错误信息输出到 stderr
Merge pull request !1389 from dhb52/N/A
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 | 17 | import argparse |
| 18 | 18 | import pathlib |
| 19 | 19 | import re |
| 20 | +import sys | |
| 20 | 21 | import time |
| 21 | 22 | from abc import ABC, abstractmethod |
| 22 | 23 | from typing import Dict, Generator, Optional, Tuple, Union |
| ... | ... | @@ -293,8 +294,10 @@ class Convertor(ABC): |
| 293 | 294 | |
| 294 | 295 | # 将parse失败的脚本打印出来 |
| 295 | 296 | if error_scripts: |
| 297 | + print("!!! 以下内容无法正常解析", file=sys.stderr) | |
| 296 | 298 | for script in error_scripts: |
| 297 | - print(script) | |
| 299 | + # print to stderr | |
| 300 | + print(script, file=sys.stderr) | |
| 298 | 301 | |
| 299 | 302 | |
| 300 | 303 | class PostgreSQLConvertor(Convertor): | ... | ... |