Commit Graph

132 Commits

Author SHA1 Message Date
Kevin Wan
289a325757
chore: refine docker for better compatible with package main (#1944)
* chore: refine docker for better compatible with package main

* chore: default to current dir on goctl docker command
2022-05-30 13:26:58 +08:00
anqiansong
58787746db
fix: Useless delete cache logic in update (#1923)
* Fix bug: useless delete cache logic in update

* Format code
2022-05-23 09:12:06 +08:00
anqiansong
f486685e99
Fix code generation (#1897) 2022-05-13 00:16:17 +08:00
anqiansong
5383e29ce6
feat: Replace cli to cobra (#1855)
* Replace cli

* Replace cli

* Replace cli

* Format code

* Add compare case

* Add compare case

* Add compare case

* Support go style flag

* Support go style flag

* Add test case
2022-05-07 15:40:11 +08:00
anqiansong
cc09ab2aba
feat: Support model code generation for multi tables (#1836)
* Support model code generation for multi tables

* Format code

* Format code

Co-authored-by: anqiansong <anqiansong@bytedance.com>
2022-04-28 10:01:04 +08:00
Kevin Wan
5bcee4cf7c
fix #1806 (#1833)
* fix #1806

* chore: refine error text
2022-04-27 00:01:31 +08:00
anqiansong
16c61c6657
chore: Embed unit test data (#1812)
* Embed unit test data

* Add testdata

Co-authored-by: anqiansong <anqiansong@bytedance.com>
2022-04-21 21:49:09 +08:00
Fyn
036d803fbb
docs(goctl): goctl 1.3.4 migration note (#1780)
* docs(goctl): goctl 1.3.4 migration note

* adds a simple lang check
* adds migration notes

* chore: remove i18n

* chore: remove todo
2022-04-18 14:42:13 +08:00
方航
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
Kevin Wan
415c4c91fc
fix: model unique keys generated differently in each re-generation (#1771) 2022-04-09 00:25:23 +08:00
anqiansong
8dd764679c
Fix #1765 (#1767)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
2022-04-07 10:40:21 +08:00
Kevin Wan
faad6e27e3
feat: use go:embed to embed templates (#1756) 2022-04-04 13:12:05 +08:00
Kevin Wan
dfd58c213c
fix: model generation bug on with cache (#1743)
* fix: model generation bug on with cache

* chore: refine template

* chore: fix test failure
2022-04-02 15:36:06 +08:00
Kevin Wan
6dccfa29fd
feat: let model customizable (#1738) 2022-04-01 22:19:52 +08:00
Fyn
f4471846ff
feat(goctl): supports model code 'DO NOT EDIT' (#1728)
Resolves: #1710
2022-04-01 14:48:45 +08:00
Mikael
d8054d8def
fix -cache=true insert no clean cache (#1672)
* fix -cache=true insert no clean cache

* fix -cache=true insert no clean cache
2022-03-23 18:55:16 +08:00
Fyn
17e0afeac0
fix(goctl): model method FindOneCtx should be FindOne (#1656) 2022-03-17 17:16:53 +08:00
xybingbing
09e6d94f9e
FindOneBy 漏 Context (#1642) 2022-03-14 18:56:26 +08:00
anqiansong
68a81fea8a
Fix #1609 (#1617) 2022-03-05 22:52:32 +08:00
Kevin Wan
f15a4f9188
chore: update go-zero to v1.3.1 in goctl (#1599) 2022-03-01 20:56:57 +08:00
Kevin Wan
e31128650e
Revert "🐞 fix(gen): pg gen of insert (#1591)" (#1598)
This reverts commit cc4c4928e0.
2022-03-01 20:27:59 +08:00
toutou_o
cc4c4928e0
🐞 fix(gen): pg gen of insert (#1591)
Co-authored-by: kurimi1 <d0n41df@gmail.com>
2022-03-01 19:53:23 +08:00
Kevin Wan
e0454138e0
update goctl to go 1.16 for io/fs usage (#1571)
* update goctl to go 1.16 for io/fs usage

* feat: support pg serial type for auto_increment (#1563)

* add correct example for pg's url

* 🐞 fix: merge

* 🐞 fix: pg default port

*  feat: support serial type

Co-authored-by: kurimi1 <d0n41df@gmail.com>

* chore: format code

Co-authored-by: toutou_o <33993460+kurimi1@users.noreply.github.com>
Co-authored-by: kurimi1 <d0n41df@gmail.com>
2022-02-24 13:58:53 +08:00
toutou_o
3b07ed1b97
feat: support pg serial type for auto_increment (#1563)
* add correct example for pg's url

* 🐞 fix: merge

* 🐞 fix: pg default port

*  feat: support serial type

Co-authored-by: kurimi1 <d0n41df@gmail.com>
2022-02-24 13:39:31 +08:00
Kevin Wan
aa29036cb3
feat: support ctx in sql model generation (#1551) 2022-02-17 10:28:55 +08:00
Kevin Wan
a40254156f
refactor: refactor yaml unmarshaler (#1517) 2022-02-09 17:22:52 +08:00
Kevin Wan
50174960e4
chore: update command comment (#1501) 2022-02-02 22:02:08 +08:00
Kevin Wan
ec299085f5
docs: update tal-tech to zeromico in docs (#1498) 2022-02-01 13:03:30 +08:00
Kevin Wan
4b7a680ac5
refactor: rename from tal-tech to zeromicro for goctl (#1481) 2022-01-25 23:15:07 +08:00
anqiansong
e57fa8ff53
Fix/issue#1447 (#1458)
* Add data for template to render

* fix #1447

Co-authored-by: anqiansong <anqiansong@bytedance.com>
2022-01-18 10:36:38 +08:00
anqiansong
9b592b3dee
Feature rpc protoc (#1251)
* code generation by protoc

* generate pb by protoc direct

* support: grpc code generation by protoc directly

* format code

* check --go_out & --go-grpc_out

* fix typo

* Update version

* fix typo

* optimize: remove deprecated unit test

* format code

Co-authored-by: anqiansong <anqiansong@bytedance.com>
2022-01-11 20:34:25 +08:00
spectatorMrZ
240132e7c7
Fix pg model generation without tag (#1407)
1. fix pg model struct haven't tag
2. add pg command test from datasource
2022-01-07 10:45:26 +08:00
Kevin Wan
a91c3907a8
feat: rename module from tal-tech to zeromicro (#1413) 2022-01-04 15:51:32 +08:00
Kevin Wan
e267d94ee1
chore: update go-zero to v1.2.5 (#1410) 2022-01-03 21:54:53 +08:00
anqiansong
89ce5e492b
refactor file|path (#1409)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
2022-01-03 21:32:40 +08:00
Kevin Wan
d6ff30a570
chore: fix golint issues (#1396) 2021-12-30 17:44:15 +08:00
anqiansong
b8ea16a88e
feat: Add --remote (#1387)
Co-authored-by: anqiansong <anqiansong@bytedance.com>
2021-12-29 18:16:42 +08:00
anqiansong
49bab23c54
fix #1376 (#1380)
* fix #1376

* fix #1376

Co-authored-by: anqiansong <anqiansong@bytedance.com>
2021-12-28 16:40:26 +08:00
行者
f5f2097d14
Updated MySQL生成表结构体遇到关键字db部分保持原字段名定义 (#1369) 2021-12-26 21:56:04 +08:00
Kevin Wan
1becaeb7be
chore: refactor (#1331) 2021-12-15 20:44:23 +08:00
yangkequn
171afaadb9
Update types.go (#1314) 2021-12-15 20:16:17 +08:00
anqiansong
b0573af9a9
Update template (#1243) 2021-11-15 21:02:11 +08:00
anqiansong
69a4d213a3
Fix issue 1205 (#1211)
* fix #1205

* move builder into stores

* remove xrom

* Remove unused code

* Remove unused code

* refactor builderx to builder

Co-authored-by: anqiansong <anqiansong@bytedance.com>
2021-11-07 22:44:37 +08:00
anqiansong
9c48e9ceab
Feature add template version (#1152) 2021-10-29 09:55:41 +08:00
anqiansong
44202acb18
Fix issue #1127 (#1131)
* fix #1127

* fix #1127

* fixed unit test

* add go keyword converter

Co-authored-by: anqiansong <anqiansong@bytedance.com>
2021-10-13 20:48:47 +08:00
Kevin Wan
65905b914d
ci: add reviewdog (#1096) 2021-09-29 13:09:20 +08:00
Kevin Wan
2e12cd2c99
coding style (#1083) 2021-09-23 11:19:57 +08:00
anqiansong
9a724fe907
Add MustTempDir (#1069) 2021-09-21 10:13:43 +08:00
Kevin Wan
f6d9e19ecb
expose sql.DB to let orm operate on it (#1015)
* expose sql.DB to let orm operate on it

* add missing RawDB methods

* add NewSqlConnFromDB for cooperate with dtm
2021-09-09 11:40:28 +08:00
toven tang
d179b342b2
修复使用 postgres 数据库时,位置参数重复,导致参数与值不对应的问题。 (#960)
* 修复使用 postgres 数据库时,位置参数重复,导致参数与值不对应的问题。

* 修复使用 postgres 数据库时,位置参数重复,导致参数与值不对应的问题。

Co-authored-by: toven <toven@advan.onaliyun.com>
2021-09-05 22:27:59 +08:00