Makefile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. .PHONY: build build-endtoend test test-ci test-examples test-endtoend start psql mysqlsh proto
  2. build:
  3. go build ./...
  4. install:
  5. go install ./...
  6. test:
  7. go test ./...
  8. test-managed:
  9. MYSQL_SERVER_URI="invalid" POSTGRESQL_SERVER_URI="postgres://postgres:mysecretpassword@localhost:5432/postgres" go test -v ./...
  10. vet:
  11. go vet ./...
  12. test-examples:
  13. go test --tags=examples ./...
  14. build-endtoend:
  15. cd ./internal/endtoend/testdata && go build ./...
  16. test-ci: test-examples build-endtoend vet
  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