-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
24 lines (23 loc) · 853 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
createdb:
docker exec -ti postgres createdb --username=root --owner=root simple_bank
dropdb:
docker exec -ti postgres dropdb simple_bank
postgres:
docker run --name postgres -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=secret -d postgres:12-alpine
migrateinit:
migrate create -ext sql -dir db/migration -seq init_schema
migrateup:
migrate -path db/migration -database "postgres://root:secret@localhost:5432/simple_bank?sslmode=disable" -verbose up
migratedown:
migrate -path db/migration -database "postgres://root:secret@localhost:5432/simple_bank?sslmode=disable" -verbose down
removepg:
docker kill postgres && docker rm postgres
sqlcgen:
sqlc generate
gotest:
go test -v -cover ./...
gobuild:
go build -v ./...
start:
go run main.go
.PHONY: postgres createdb dropdb migrateup migratedown removepg sqlcgen gotest gobuild start