b1f8ac453b
feat!: base template * first bit of templating * codeowners * linuxbased * restart * baseline project * add grpc api and basic integration test * startqueue * queueMsg * splitscripts * migrations * queueintegrationtest * gateway
24 lines
609 B
YAML
24 lines
609 B
YAML
# https://taskfile.dev
|
|
|
|
version: '3'
|
|
|
|
vars:
|
|
MIGRATIONS: "{{.CONTEXT}}/database/migrations"
|
|
DATABASE_URI: "postgres://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}?sslmode=disable"
|
|
|
|
tasks:
|
|
generate:
|
|
cmds:
|
|
- sqlc generate --file ../sqlc.yml
|
|
lint:
|
|
cmds:
|
|
- sqlc vet --file ../sqlc.yml
|
|
mig:create:
|
|
cmds:
|
|
- |
|
|
read -p "Migration Name: " name
|
|
test -z "$name" && echo "Error: Name is required." && exit 1
|
|
migrate create -ext sql -dir {{.MIGRATIONS}} $name
|
|
mig:run:
|
|
cmds:
|
|
- migrate -path {{.MIGRATIONS}} -database {{.DATABASE_URI}} up |