Commit Graph

191 Commits

Author SHA1 Message Date
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
miaogaolin
423955c55f
format code (#979) 2021-08-31 17:15:36 +08:00
Kevin Wan
7618139dad
refactor (#977) 2021-08-31 12:04:09 +08:00
anqiansong
3203f8e06b
Fix issues (#965) 2021-08-27 15:05:54 +08:00
chenquan
b71ac2042a
Add a test case for database code generation tool (#961) 2021-08-27 06:50:09 +08:00
anqiansong
189721da16
Fix issues (#931)
* fix #929

* fix #925

* add test case

* update model README

* fix #929

* fix #929

* fix #929

* refactor dir

* Adding todo comments

Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
2021-08-19 22:47:45 +08:00
anqiansong
b2fea65faa
Optimize model naming (#910)
* add unit test

* fix #907

* format code

* format code

* format code

Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
2021-08-18 17:09:34 +08:00
anqiansong
a1fe8bf6cd
fix missing updateMethodTemplateFile (#924) 2021-08-18 12:23:43 +08:00
anqiansong
dc43430812
optimize grpc generation env check (#900)
* optimize grpc generation env check

* optimize grpc generation env check

* format code

* fix postgresql data type convert error

Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
2021-08-13 11:47:42 +08:00
Kevin Wan
69935c1ba3
refactor goctl, fix golint issues (#903) 2021-08-11 18:08:01 +08:00
市民233
0b0406f41a
fix: 解决golint 部分警告 (#897)
* feat:  解决goreportcard的警报
ps: warning: if block ends with a return statement, so drop this else and outdent its block (golint)

* feat: 优化golint警告,将processFieldPrimitiveWithJsonNumber 改成 processFieldPrimitiveWithJSONNumber
unmarshaler.go:248:23: method processFieldPrimitiveWithJsonNumber should be processFieldPrimitiveWithJSONNumber

* feat: 添加 WithCanonicalKeyFunc 注释

* feat: 添加DisableStat的注释

* feat: 添加 RegisterGoctlHome 注释

* feat: 添加 PostgreSqlJoin 注释

* feat: 解决goline警告should not use basic type string as key in context.WithValue问题

* feat: 解决golint警告信息: should not use basic type string as key in context.WithValue

* fix: 定义自定义字段类型,导致go test fail 问题

* update: 恢复原有测试用例

* fix golint warning
2021-08-11 17:57:20 +08:00
Kevin Wan
02adcccbf4
format code (#884) 2021-08-09 18:11:08 +08:00
anqiansong
a74aaf1823
optimize mongo generation without cache (fix #881) (#882)
* fix #881

* fix #881

Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
2021-08-09 11:33:01 +08:00
toutou_o
a5e1d0d0dc
add correct example for pg's url (#857) 2021-07-30 13:58:44 +08:00
anqiansong
9f4a882a1b
fix issue #831 (#850)
* fix issue #831

* fix typo

Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
2021-07-28 16:32:15 +08:00
anqiansong
cb7b7cb72e
fix issue #836 (#849)
Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
2021-07-27 22:13:17 +08:00
anqiansong
089cdaa75f
Feature model postgresql (#842)
* Support postgresql generate

* Update template Var

* Support to generate postgresql model

* Support to generate postgresql model

* Update template

Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
2021-07-23 11:45:15 +08:00
fangjianwei
476026e393
Added database prefix of cache key. (#835) 2021-07-22 11:29:09 +08:00
Kevin Wan
e47079f0f4
go format with extra rules (#821) 2021-07-17 20:51:23 +08:00
anqiansong
9b2a279948
Fix issues: #725, #740 (#813)
* Fix issues: #725, #740

* Update filed sort

Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
2021-07-16 22:55:39 +08:00
anqiansong
ea4f680052
Fix issue #747 (#765)
Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
2021-06-15 18:54:41 +08:00
anqiansong
453f949638
replace cache key with colon (#746)
Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
2021-06-02 10:37:49 +08:00
Kevin Wan
f300408fc0
fix golint issues, and optimize code (#705) 2021-05-21 10:38:38 +08:00
Bo-Yi Wu
73906f996d
chore(format): change by gofumpt tool (#697)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2021-05-18 14:43:09 +08:00
anqiansong
ea01cc78f0
Optimize model nl (#686) 2021-05-12 12:28:23 +08:00
Bo-Yi Wu
afd9ff889e
chore: update code format. (#628) 2021-04-15 19:49:17 +08:00
anqiansong
888551627c
optimize code (#579)
* optimize code

* optimize returns & unit test
2021-03-27 17:33:17 +08:00
Kevin Wan
155e6061cb
fix golint issues (#561) 2021-03-12 23:08:04 +08:00
anqiansong
dda7666097
Feature mongo gen (#546)
* add feature: mongo code generation

* upgrade version

* update doc

* format code

* update update.tpl of mysql
2021-03-12 17:49:28 +08:00
anqiansong
60c7edf8f8
fix spelling (#551) 2021-03-08 18:23:12 +08:00
Kevin Wan
f01472c9ea
fix golint issues (#535) 2021-03-02 11:02:57 +08:00
Kevin Wan
af531cf264
fix golint issues (#533) 2021-03-02 00:11:18 +08:00
anqiansong
dd393351cc
patch 1.1.5 (#530) 2021-03-01 21:14:07 +08:00
anqiansong
d894b88c3e
feature 1.1.5 (#411) 2021-03-01 17:29:07 +08:00
kingxt
e6ef1fca12
Code optimized (#523)
* optimized markdown generator

* optimized markdown generator

* optimized markdown generator

* add more comment

* add comment

* add comment

* add comments for rpc tool

* add comments for model tool

* add comments for model tool

* add comments for model tool

* add comments for config tool

* add comments for config tool

* add comments

* add comments

* add comments

* add comments

* add comment

* remove rpc main head info

* add comment

* optimized

Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
2021-02-26 16:11:47 +08:00
kingxt
f98c9246b2
Code optimized (#493) 2021-02-20 19:50:03 +08:00
Kevin Wan
211f3050e9
fix golint issues (#459) 2021-02-09 14:10:38 +08:00
Kevin Wan
03b5fd4a10
fix golint issues (#458) 2021-02-09 14:03:19 +08:00
Kevin Wan
5e969cbef0
fix golint issues, else blocks (#457) 2021-02-09 13:50:21 +08:00
Kevin Wan
42883d0899
fix golint issues, redis methods (#455) 2021-02-09 10:58:11 +08:00
Kevin Wan
06f6dc9937
fix golint issues, package comments (#454) 2021-02-08 22:31:52 +08:00
Kevin Wan
9b0625bb83
fix golint issues (#450) 2021-02-08 17:08:40 +08:00
Kevin Wan
50fbdbcfd7
update readme (#390) 2021-01-14 22:26:31 +08:00
Kevin Wan
eca4ed2cc0
format code (#386) 2021-01-14 13:24:24 +08:00
文杰
3285436f75
f-fix spell (#381)
Co-authored-by: chenwenjie <chenwenjie@zzstc.cn>
2021-01-13 18:07:31 +08:00
anqiansong
6c624a6ed0
Feature model fix (#362)
* fix sql builderx adding raw string quotation marks incompatibility bug

* add unit test

* remove comments

* fix sql builderx adding raw string quotation marks incompatibility bug
2021-01-08 12:01:21 +08:00
anqiansong
a3b525b50d
feature model fix (#296)
* add raw stirng quote for sql field

* remove unused code
2020-12-21 09:43:32 +08:00
Kevin Wan
da8f76e6bd
add category docker & kube (#276) 2020-12-11 18:53:40 +08:00
Kevin Wan
65ee877236
refactor & format code (#255) 2020-12-08 23:01:25 +08:00
songmeizi
4d53045c6b
improve data type conversion (#236)
* improve data type conversion

* update doc
2020-12-08 18:06:15 +08:00
Keson
6e57f6c527
feature model interface (#222)
* make variable declaration more concise

* add model interface

* optimize interface methods

* fix: go test failed

* warp returns

* optimize
2020-11-24 22:36:23 +08:00
kingxt
b9ac51b6c3
feature: file namestyle (#223)
* add api filename style

* new feature: config.yaml

* optimize

* optimize logic generation

* check hanlder valid

* optimize

* reactor naming style

* optimize

* optimize test

* optimize gen middleware

* format

Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
Co-authored-by: kim <xutao@xiaoheiban.cn>
2020-11-24 15:11:18 +08:00
Keson
24fb29a356
patch model&rpc (#207)
* change column to read from information_schema

* reactor generate mode from datasource

* reactor generate mode from datasource

* add primary key check logic

* resolve rebase conflicts

* add naming style

* add filename test case

* resolve rebase conflicts

* reactor test

* add test case

* change shell script to makefile

* update rpc new

* update gen_test.go

* format code

* format code

* update test

* generates alias
2020-11-18 15:32:53 +08:00
Keson
48f4154ea8
update doc (#193) 2020-11-08 13:02:48 +08:00
Keson
e76f44a35b
reactor rpc (#179)
* reactor rpc generation

* update flag

* update command

* update command

* update unit test

* delete test file

* optimize code

* update doc

* update gen pb

* rename target dir

* update mysql data type convert rule

* add done flag

* optimize req/reply parameter

* optimize req/reply parameter

* remove waste code

* remove duplicate parameter

* format code

* format code

* optimize naming

* reactor rpcv2 to rpc

* remove new line

* format code

* rename underline to snake

* reactor getParentPackage

* remove debug log

* reactor background
2020-11-05 14:12:47 +08:00
kevin
b144a2335c update bookstore example for generation prototype 2020-10-31 11:42:44 +08:00
Keson
607fc3297a
model template fix (#169)
* replace quote

* rpc disable override main.go

* reactor template

* add model flag -style

* add model flag -style

* reactor model  template name of error
2020-10-27 22:42:53 +08:00
Keson
2b7545ce11
spell fix (#167) 2020-10-26 16:33:02 +08:00
Keson
60925c1164
fix bug: generate incomplete model code in case findOneByField (#160)
* fix bug: generate incompletely in case findOneByField

* code break line

* add test

* revert command.go

* add test

* remove incorrect test
2020-10-25 23:21:55 +08:00
Keson
c9494c8bc7
model support globbing patterns (#153)
* model support globbing patterns

* optimize model

* optimize model

* format code
2020-10-22 18:33:09 +08:00
Keson
41964f9d52
gozero template (#147)
* model/rpc generate code from template cache

* delete unused(deprecated) code

* support template init|update|clean|revert

* model: return the execute result for insert and update operation

* // deprecated: containsAny

* add template test

* add default buildVersion

* update build version
2020-10-21 14:59:35 +08:00
kevin
dfe6e88529 use goctl template to generate all kinds of templates 2020-10-19 23:13:18 +08:00
kevin
94645481b1 fix golint issues 2020-10-16 10:50:43 +08:00
kevin
f904710811 support api templates 2020-10-15 16:36:49 +08:00
Keson
7d4a548d29
fix: template cache key (#121) 2020-10-12 14:34:11 +08:00
Keson
7e61555d42
Gozero sqlgen patch (#119)
* merge upstream

* optimize insert logic

* reactor functions
2020-10-11 21:55:44 +08:00
miaogaolin
68335ada54
rename file and function name (#74) 2020-09-16 13:30:47 +08:00
Sergey Cheung
21e811887c
Markdown lint (#58)
* markdown linter

* format markdown docs

* format exiting markdown docs
2020-09-11 19:42:58 +08:00
Keson
d12e9fa2d7
add model&rpc doc (#62) 2020-09-11 16:47:21 +08:00
miaogaolin
ce5961a7d0
fix goctl model (#61) 2020-09-11 16:46:45 +08:00
kevin
8dd93d59a0 refactor code 2020-09-03 14:00:09 +08:00
Keson
3a4e1cbb33
fix bug: miss time import (#36)
* add execute files

* add protoc-osx

* add rpc generation

* add rpc generation

* add: rpc template generation

* optimize gomod cache

* add README.md

* format error

* reactor templatex.go

* update project.go & README.md

* fix bug: miss time import
2020-09-03 13:57:28 +08:00
kevin
6c4a4be5d2 update shorturl doc 2020-08-29 20:27:52 +08:00
kevin
f411178a4f refine rpc generator 2020-08-28 22:44:41 +08:00
Keson
db16115037
rpc service generation (#26)
* add execute files

* add protoc-osx

* add rpc generation

* add rpc generation

* add: rpc template generation

* update usage

* fixed env prepare for project in go path

* optimize gomod cache

* add README.md

* format error

* reactor templatex.go

* remove waste code
2020-08-28 19:24:58 +08:00
kevin
77e23ad65d add quick example 2020-08-27 22:54:18 +08:00
kevin
267a283328 reorg imports 2020-08-20 10:46:39 +08:00
Keson
db83843558
gocctl model v20200819 (#18)
* rename snake、came method

* new: generate model from data source

* add change log md

* update model doc

* update  doc

* beauty code
2020-08-20 10:29:18 +08:00
kevin
e79c42add1 add go report badge 2020-08-19 16:10:43 +08:00
Keson
d21d770b5b
goctl model reactor (#15)
* reactor sql generation

* reactor sql generation

* add console & example

* optimize unit test & add document

* modify default config

* remove test file

* Revert "remove test file"

This reverts commit 81041f9e

* fix stringx.go & optimize example

* remove unused code
2020-08-19 10:41:19 +08:00
kingxt
a71a11b7c5 remove deprecated 2020-08-10 18:18:13 +08:00
kevin
0a7e0cce77 update package reference 2020-08-08 16:40:10 +08:00
kim
121323b8c3 goctl added 2020-07-29 17:12:04 +08:00