Generate caches that support custom key prefix. (#4643)

This commit is contained in:
kesonan
2025-02-12 23:31:30 +08:00
committed by GitHub
parent 48d0709ca6
commit 7a4818da59
9 changed files with 60 additions and 45 deletions

View File

@@ -3,15 +3,15 @@
# generate model with cache from ddl
fromDDLWithCache:
goctl template clean
goctl model mysql ddl -src="./sql/*.sql" -dir="./sql/model/cache" -cache
goctl model mysql ddl -src="./sql/*.sql" -dir="./sql/model/cache" -cache --prefix gozero
fromDDLWithCacheAndIgnoreColumns:
goctl template clean
goctl model mysql ddl -src="./sql/*.sql" -dir="./sql/model/ignore_columns/cache" -cache -i 'gmt_create,create_at' -i 'gmt_modified,update_at'
goctl model mysql ddl -src="./sql/*.sql" -dir="./sql/model/ignore_columns/cache" -cache -i 'gmt_create,create_at' -i 'gmt_modified,update_at' --prefix gozero
fromDDLWithCacheAndDb:
goctl template clean
goctl model mysql ddl -src="./sql/*.sql" -dir="./sql/model/cache_db" -database="1gozero" -cache
goctl model mysql ddl -src="./sql/*.sql" -dir="./sql/model/cache_db" -database="1gozero" -cache --prefix gozero
fromDDLWithoutCache:
goctl template clean;
@@ -19,11 +19,11 @@ fromDDLWithoutCache:
# generate model with cache from data source
user=root
password=password
datasource=127.0.0.1:3306
database=gozero
user=app_user
password=PLO75FbcfmFYRuQEGmygZ9PyQCQbmgeD5
datasource=k8s-istiosys-unifydev-2cdcebd306-b64e09be84220820.elb.ap-southeast-1.amazonaws.com:3306
database=db_fiat
fromDataSource:
goctl template clean
goctl model mysql datasource -url="$(user):$(password)@tcp($(datasource))/$(database)" -table="*" -dir ./model/cache -c -style gozero
goctl model mysql datasource -url="$(user):$(password)@tcp($(datasource))/$(database)" -table="biz_switch" -dir ./model/cache -c -style gozero --prefix gozero