-
Notifications
You must be signed in to change notification settings - Fork 713
Open
Description
Describe the bug
A clear and concise description of what the bug is.
my sql
import sqlparse
sql = """
CREATE TABLE t_user_gs_hsakjhkj (
id int AUTO_INCREMENT NOT NULL COMMENT '主键',
create_time datetime NOT NULL COMMENT '创建时间' DEFAULT CURRENT_TIMESTAMP,
update_time datetime COMMENT '更新时间' DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
t_user_id int NOT NULL COMMENT '用户表主键id',
occupation_id varchar(225) NOT NULL COMMENT 'occupation_id',
service_order_id varchar(225) NOT NULL COMMENT '订单id',
PRIMARY KEY (id),
UNIQUE INDEX un_t_user_idx (t_user_id)
);
"""
print(sqlparse.format(sql, reindent=True, keyword_case='upper'))
result
CREATE TABLE t_user_gs_hsakjhkj
(id int AUTO_INCREMENT NOT NULL COMMENT '主键',
create_time datetime NOT NULL COMMENT '创建时间' DEFAULT CURRENT_TIMESTAMP,
update_time datetime COMMENT '更新时间' DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
t_user_id int NOT NULL COMMENT '用户表主
键id',
occupation_id varchar(225) NOT NULL COMMENT 'occupation_id',
service_order_id varchar(225) NOT NULL COMMENT '订单id',
PRIMARY KEY (id), UNIQUE INDEX un_t_user_idx (t_user_id));
To Reproduce
Steps to reproduce the behavior.
Please give code examples or concete SQL statements. Take care of not posting any sensitive information when pasting SQL statements!
What's the concrete error / traceback.
Expected behavior
A clear and concise description of what you expected to happen.
Versions (please complete the following information):
- Python: [e.g. 3.10.7]
- sqlparse: [e.g.0.5.3]
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
No labels