postgres

command
v0.0.0-...-1607f05 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: MIT Imports: 13 Imported by: 0

README

machine environment

go get -tags 'postgres' -u github.com/golang-migrate/migrate/cmd/migrate

create new migration

migrate create -ext sql -dir db/migrations -seq create_items_table

run migrations on db

export POSTGRES_URL="postgres://user:pass@localhost:5432/test_db?sslmode=disable"
migrate -database ${POSTGRES_URL} -path db/migrations up

how to run

docker-compose up
#<migrations>
go run main.go

curl test

curl -X POST http://localhost:8090/v1/items -H "Content-type: application/json" -d '{ "name": "lorem ipsum item", "description": "is existing"}'
curl http://localhost:8090/v1/items
curl http://localhost:8090/v1/items/1

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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