c

module
v0.0.0-...-59c1df8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2021 License: MIT

README

c

An api

Connecting to Postgres

Spinning up Containers

> docker-compose up --build

Connecting to PG container

> docker exec -it $(docker ps --filter name=pg --format "{{.Names}}") /bin/bash

Connecting to DB

> psql -U postgres -W

PostGres Commands

List Dbs

  • >\l

Connect to db

  • >\c <name-of-db>

List tables in db

  • \dt
Cleaning up
remove all containers

> docker container rm -f $(docker container ps -a -q)

clear volumes

> docker volume prune -f

DB migrations without stopping the services

migrate db down
go run cmd/dbmigrate/main.go \
-migrate=down \
-dbname=compliagotest \
-dbhost=localhost
now bring it back up
go run cmd/dbmigrate/main.go \
-migrate=up \
-dbname=compliagotest \
-dbhost=localhost

Directories

Path Synopsis
cmd
api command
dbmigrate command
pkg
db

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL