makefile 569 B

123456789101112131415161718192021
  1. #!/bin/bash
  2. # generate model with cache from ddl
  3. fromDDLWithCache:
  4. goctl template clean
  5. goctl model mysql ddl -src="./sql/*.sql" -dir="./sql/model/cache" -cache
  6. fromDDLWithoutCache:
  7. goctl template clean;
  8. goctl model mysql ddl -src="./sql/*.sql" -dir="./sql/model/nocache"
  9. # generate model with cache from data source
  10. user=root
  11. password=password
  12. datasource=127.0.0.1:3306
  13. database=gozero
  14. fromDataSource:
  15. goctl template clean
  16. goctl model mysql datasource -url="$(user):$(password)@tcp($(datasource))/$(database)" -table="*" -dir ./model/cache -c -style gozero