https://github.com/ernitingarg/golang-postgres-sqlc-auth-api
https://github.com/ernitingarg/golang-postgres-sqlc-auth-api
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ernitingarg/golang-postgres-sqlc-auth-api
- Owner: ernitingarg
- Created: 2023-11-05T12:58:07.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-18T03:56:03.000Z (over 2 years ago)
- Last Synced: 2025-05-16T12:12:55.246Z (about 1 year ago)
- Language: Go
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Overview
## Prerequisites installation
- Dbeaver Universal database GUI tool: [Download](https://dbeaver.io/download/)
- Make:
- [Download](https://gnuwin32.sourceforge.net/packages/make.htm) or `choco install make`
- `make --version`
- `golang-migrate`:
- [Download](https://github.com/golang-migrate/migrate/tree/master/cmd/migrate)
- `migrate --version`
- `sqlc` (if not to be used as docker)
- [Download](https://docs.sqlc.dev/en/latest/overview/install.html)
- `sqlc version`
## Run docker containers locally
To run container, please follow below steps:
- Download docker
- [Windows](https://docs.docker.com/desktop/install/windows-install/)
- [Ubuntu](https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository)
- Run docker containers
```bash
make start
```
- To stop docker containers
```bash
make stop
```
- To remove docker containers
```bash
make remove
```
- To see containers logs
```bash
make logs_db
make logs_sqlc
```
- To connect to Postgres database manually
```bash
docker exec -it postgres bash
psql -U admin -d postgresdb
```
- To see all tables in database
```bash
\dt;
```
## Migration
- To create migration
```bash
make migrate_create
```
- To apply migration
```bash
make migrate_up
make migrate_down
```