-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (27 loc) · 857 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
BIN_DIR:=$(shell pwd)/bin
.PHONY: local-server
local-server:
go run ./cmd server local
.PHONY: network-server
network-server:
go run ./cmd server network
.PHONY: test
test:
go test ./...
.PHONY: tools
tools:
go get .
GOBIN=$(BIN_DIR) go install github.com/sqldef/sqldef/cmd/psqldef@$(shell go list -m -f "{{.Version}}" github.com/sqldef/sqldef)
GOBIN=$(BIN_DIR) go install github.com/sqlc-dev/sqlc/cmd/sqlc@$(shell go list -m -f "{{.Version}}" github.com/sqlc-dev/sqlc)
.PHONY: migrate-db
migrate-db:
$(BIN_DIR)/psqldef -U postgres -W postgres -p 5432 -f ./db/core.sql --enable-drop-table wplus
.PHONY: dry-migrate-db
dry-migrate-db:
$(BIN_DIR)/psqldef -U postgres -W postgres -p 5432 --dry-run -f ./db/core.sql --enable-drop-table wplus
.PHONY: sqlc-gen
sqlc-gen:
$(BIN_DIR)/sqlc generate
.PHONY: sqlc-lint
sqlc-lint:
$(BIN_DIR)/sqlc vet