-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
23 lines (21 loc) · 1007 Bytes
/
Copy pathMakefile
File metadata and controls
23 lines (21 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Easily setup the development environment by running make <command name>
postgres:
docker run --name postgres15 -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=Madara123 -d postgres:15-alpine
createdb:
docker exec -it postgres15 createdb --username=root --owner=root simple_bank
dropdb:
docker exec -it postgres15 dropdb --username=root simple_bank
migrateup:
migrate -path db/migrations -database "postgresql://root:Madara123@localhost:5432/simple_bank?sslmode=disable" -verbose up
migratedown:
migrate -path db/migrations -database "postgresql://root:Madara123@localhost:5432/simple_bank?sslmode=disable" -verbose down
sqlc:
sqlc generate
test:
go test -v -cover ./...
mock:
# the --build_flags=--mod=mod may be removed in the future.should only be used if you encounter errors on th first run.
mockgen -package mockdb -destination db/mock/store.go github.com/Richd0tcom/SafeX-Pay/db/sqlc Store
server:
go run main.go
.PHONY: postgres dropdb createdb migrateup migratedown test server