Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ernitingarg/golang-postgres-sqlc-auth-api
https://github.com/ernitingarg/golang-postgres-sqlc-auth-api
Last synced: about 5 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/ernitingarg/golang-postgres-sqlc-auth-api
- Owner: ernitingarg
- Created: 2023-11-05T12:58:07.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-18T03:56:03.000Z (12 months ago)
- Last Synced: 2024-06-21T17:02:02.874Z (5 months 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
```