makefile 712 B

12345678910111213141516171819202122232425
  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. fromDDLWithCacheAndDb:
  7. goctl template clean
  8. goctl model mysql ddl -src="./sql/*.sql" -dir="./sql/model/cache_db" -database="1gozero" -cache
  9. fromDDLWithoutCache:
  10. goctl template clean;
  11. goctl model mysql ddl -src="./sql/*.sql" -dir="./sql/model/nocache"
  12. # generate model with cache from data source
  13. user=root
  14. password=password
  15. datasource=127.0.0.1:3306
  16. database=gozero
  17. fromDataSource:
  18. goctl template clean
  19. goctl model mysql datasource -url="$(user):$(password)@tcp($(datasource))/$(database)" -table="*" -dir ./model/cache -c -style gozero