File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 44
55
66def load ():
7- with open ('./template.yaml' , 'r' ) as f :
7+ with open ('./template.yaml' , 'r' , encoding = 'utf-8' ) as f :
88 global base_template
99 base_template = yaml .load (f , Loader = yaml .SafeLoader )
1010
Original file line number Diff line number Diff line change @@ -7,8 +7,12 @@ template:
77 - 生成的SQL必须符合{engine}的规范。
88 - 根据表结构生成SQL语句。
99 - SQL查询中不能使用星号(*),必须明确指定字段名.
10- - SQL查询的字段名和别名必须为英文 。
10+ - SQL查询的字段名不要自动翻译,别名必须为英文 。
1111 - 计算占比,百分比类型字段,保留两位小数,以%结尾。
12+ - 生成SQL时,必须避免关键字冲突:
13+ - 如{engine}是 PostgreSQL、Oracle,则在schema、表名、字段名、别名外层加双引号;
14+ - 如{engine}是 MySQL,则在表名、字段名、别名外层加反引号;
15+ - 如{engine}是 Microsoft SQL Server,则在schema、表名、字段名、别名外层加方括号。
1216 - 生成的SQL使用JSON格式返回:
1317 {{"success":true,"sql":"生成的SQL语句"}}
1418 - 问题与生成SQL无关时,直接回答:
You can’t perform that action at this time.
0 commit comments