- Dbeaver Universal database GUI tool: Download
- Make:
- Download or
choco install make
make --version
- Download or
golang-migrate
:- Download
migrate --version
sqlc
(if not to be used as docker)- Download
sqlc version
gomock
:- [Install]
go install go.uber.org/mock/mockgen@latest
mockgen --version
- [Install]
To run container, please follow below steps:
make start
- To stop docker containers
make stop
- To remove docker containers
make remove
- To see containers logs
make logs_db
make logs_sqlc
- To connect to Postgres database manually
docker exec -it postgres bash
psql -U admin -d postgresdb
- To see all tables in database
\dt;
- To create migration
make migrate_create
make migrate_create NAME=init
- To apply migration
make migrate_up
make migrate_down
- Code generation
Code from db/queries is automatically generated using sqlc docker container which has command `generate`.
- To start server
make server
- To generate mock files
make mock
- To run unit tests
make test