go-zero/tools/goctl/model/sql/gen
方航 fabea4c448
fix bug: crash when generate model with goctl. (#1777)
* fix bug: crash when generate model with goctl.

situation: column name with line.

CREATE TABLE test (
id int NOT NULL AUTO_INCREMENT,
zh-cn text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '中文简体',
PRIMARY KEY (id) USING BTREE,
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

* group imports

group imports

* Use

go-zero/tools/goctl/util/string.go
 func SafeString(in string) string {
instead of ReplaceAll

Co-authored-by: 方航 <fanghang@tange.ai>
2022-04-11 10:11:40 +08:00
..
delete.go fix: model unique keys generated differently in each re-generation (#1771) 2022-04-09 00:25:23 +08:00
field.go fix bug: crash when generate model with goctl. (#1777) 2022-04-11 10:11:40 +08:00
findone.go Fix #1765 (#1767) 2022-04-07 10:40:21 +08:00
findonebyfield.go fix: model unique keys generated differently in each re-generation (#1771) 2022-04-09 00:25:23 +08:00
gen_test.go fix: model generation bug on with cache (#1743) 2022-04-02 15:36:06 +08:00
gen.go fix: model generation bug on with cache (#1743) 2022-04-02 15:36:06 +08:00
imports.go feat: let model customizable (#1738) 2022-04-01 22:19:52 +08:00
insert.go fix bug: crash when generate model with goctl. (#1777) 2022-04-11 10:11:40 +08:00
keys_test.go refactor: rename from tal-tech to zeromicro for goctl (#1481) 2022-01-25 23:15:07 +08:00
keys.go Fix #1765 (#1767) 2022-04-07 10:40:21 +08:00
new.go refactor: rename from tal-tech to zeromicro for goctl (#1481) 2022-01-25 23:15:07 +08:00
tablename.go feat: let model customizable (#1738) 2022-04-01 22:19:52 +08:00
tag.go refactor: rename from tal-tech to zeromicro for goctl (#1481) 2022-01-25 23:15:07 +08:00
template_test.go refactor: rename from tal-tech to zeromicro for goctl (#1481) 2022-01-25 23:15:07 +08:00
template.go feat: let model customizable (#1738) 2022-04-01 22:19:52 +08:00
types.go feat(goctl): supports model code 'DO NOT EDIT' (#1728) 2022-04-01 14:48:45 +08:00
update.go fix bug: crash when generate model with goctl. (#1777) 2022-04-11 10:11:40 +08:00
vars.go refactor: rename from tal-tech to zeromicro for goctl (#1481) 2022-01-25 23:15:07 +08:00