Skip to content

knrd/go-sqlc-migrations-tests

Repository files navigation

sqlc

Install sqlc

go install github.com/kyleconroy/sqlc/cmd/sqlc@latest

Config can be found in ./sqlc.yaml

Run sqlc

sqlc generate

Server migrations

Install migrations tool

cd ~/go/bin
curl -L https://github.com/golang-migrate/migrate/releases/download/v4.15.2/migrate.linux-amd64.tar.gz | tar xvz

Apply migrations

migrate -path database/migrations -database "postgresql://postgres:qwerty@localhost:15432/postgres?sslmode=disable" up

Revert migrations

migrate -path database/migrations -database "postgresql://postgres:qwerty@localhost:15432/postgres?sslmode=disable" down

About

Golang + sqlc + migrations + tests setup

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published