-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (35 loc) · 1.57 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
postgres:
docker run --name postgres16 --network bank-network -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=password -d postgres:16-alpine
createdb:
docker exec -it postgres16 createdb --username=root --owner=root simple_bank
dropdb:
docker exec -it postgres16 dropdb simple_bank
migrateup:
migrate -path db/migration -database "postgresql://root:password@localhost:5432/simple_bank?sslmode=disable" -verbose up
migratedown:
migrate -path db/migration -database "postgresql://root:password@localhost:5432/simple_bank?sslmode=disable" -verbose down
migrateup1:
migrate -path db/migration -database "postgresql://root:password@localhost:5432/simple_bank?sslmode=disable" -verbose up 1
migratedown1:
migrate -path db/migration -database "postgresql://root:password@localhost:5432/simple_bank?sslmode=disable" -verbose down 1
new_migration:
migrate create -ext sql -dir db/migration -seq $(name)
sqlc:
sqlc generate
test:
go test -v -cover -short ./...
server:
go run main.go
mock:
mockgen -package mockdb -destination db/mock/store.go github.com/ahmedkhaeld/simplebank/db/sqlc Store
proto:
rm -f pb/*.go
protoc --proto_path=proto --go_out=pb --go_opt=paths=source_relative \
--go-grpc_out=pb --go-grpc_opt=paths=source_relative \
--grpc-gateway_out=pb --grpc-gateway_opt=paths=source_relative \
proto/*.proto
evans:
evans --host localhost --port 9090 -r repl
redis:
docker run --name redis -p 6379:6379 -d redis:7-alpine
.PHONY: postgres createdb dropdb migrateup migratedown sqlc test server mock migrateup1 migratedown1 proto evans redis new_migration