-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (26 loc) · 1.25 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
postgres:
docker run -d --name postgres_go_bank --network go_bank_network -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -d postgres:15-alpine
drop-postgres:
docker stop postgres_go_bank
docker rm postgres_go_bank
createdb:
docker exec -it postgres_go_bank createdb --username=postgres go_bank
dropdb:
docker exec -it postgres_go_bank dropdb --username=postgres go_bank
migrateup:
migrate -path db/migration -database "postgresql://postgres:postgres@localhost:5432/go_bank?sslmode=disable" -verbose up
migrateup1:
migrate -path db/migration -database "postgresql://postgres:postgres@localhost:5432/go_bank?sslmode=disable" -verbose up 1
migratedown:
migrate -path db/migration -database "postgresql://postgres:postgres@localhost:5432/go_bank?sslmode=disable" -verbose down
migratedown1:
migrate -path db/migration -database "postgresql://postgres:postgres@localhost:5432/go_bank?sslmode=disable" -verbose down 1
sqlc:
docker run --rm -v "%cd%:/src" -w /src kjconroy/sqlc generate
test:
go test -v -cover ./...
server:
go run main.go
mock:
mockgen -package mockdb -destination db/mock/store.go github.com/VL-037/go-bank/db/sqlc Store
.PHONY: postgres createdb dropdb migrateup migrateup1 migratedown migratedown1 pull-sqlc sqlc test server mock