2020-11-18 15:32:53 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# generate model with cache from ddl
|
2020-12-21 09:43:32 +08:00
|
|
|
fromDDLWithCache:
|
2021-01-08 12:01:21 +08:00
|
|
|
goctl template clean
|
|
|
|
goctl model mysql ddl -src="./sql/*.sql" -dir="./sql/model/cache" -cache
|
2020-12-21 09:43:32 +08:00
|
|
|
|
|
|
|
fromDDLWithoutCache:
|
|
|
|
goctl template clean;
|
2021-01-08 12:01:21 +08:00
|
|
|
goctl model mysql ddl -src="./sql/*.sql" -dir="./sql/model/nocache"
|
2020-11-18 15:32:53 +08:00
|
|
|
|
|
|
|
|
|
|
|
# generate model with cache from data source
|
|
|
|
user=root
|
|
|
|
password=password
|
|
|
|
datasource=127.0.0.1:3306
|
|
|
|
database=gozero
|
|
|
|
|
|
|
|
fromDataSource:
|
2021-01-08 12:01:21 +08:00
|
|
|
goctl template clean
|
|
|
|
goctl model mysql datasource -url="$(user):$(password)@tcp($(datasource))/$(database)" -table="*" -dir ./model/cache -c -style gozero
|