Makefile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. .PHONY: build build-endtoend test test-ci test-examples test-endtoend regen start psql mysqlsh proto
  2. build:
  3. go build ./...
  4. install:
  5. go install ./...
  6. test:
  7. go test ./...
  8. vet:
  9. go vet ./...
  10. test-examples:
  11. go test --tags=examples ./...
  12. build-endtoend:
  13. cd ./internal/endtoend/testdata && go build ./...
  14. test-ci: test-examples build-endtoend vet
  15. regen: sqlc-dev sqlc-gen-json
  16. go run ./scripts/regenerate/
  17. sqlc-dev:
  18. go build -o ~/bin/sqlc-dev ./cmd/sqlc/
  19. sqlc-pg-gen:
  20. go build -o ~/bin/sqlc-pg-gen ./internal/tools/sqlc-pg-gen
  21. sqlc-gen-json:
  22. go build -o ~/bin/sqlc-gen-json ./cmd/sqlc-gen-json
  23. start:
  24. docker compose up -d
  25. fmt:
  26. go fmt ./...
  27. psql:
  28. PGPASSWORD=mysecretpassword psql --host=127.0.0.1 --port=5432 --username=postgres dinotest
  29. mysqlsh:
  30. mysqlsh --sql --user root --password mysecretpassword --database dinotest 127.0.0.1:3306
  31. proto:
  32. buf generate
  33. remote-proto:
  34. protoc \
  35. --go_out=. --go_opt="Minternal/remote/gen.proto=github.com/sqlc-dev/sqlc/internal/remote" --go_opt=module=github.com/sqlc-dev/sqlc \
  36. --go-grpc_out=. --go-grpc_opt="Minternal/remote/gen.proto=github.com/sqlc-dev/sqlc/internal/remote" --go-grpc_opt=module=github.com/sqlc-dev/sqlc \
  37. internal/remote/gen.proto