river-demo
Small demo CLI for River using PostgreSQL.
It provides a rivercli command with three subcommands:
migrate – runs River schema migrations
spawn – enqueues a demo job (optionally failing)
work – starts workers to process queued jobs
Prerequisites
- Go (matching
go.mod)
- PostgreSQL
DATABASE_URL set (or pass --database-url)
Example:
export DATABASE_URL='postgres://postgres:postgres@localhost:5432/river_dev?sslmode=disable'
Install
Install the CLI with go install:
go install github.com/mheers/river-demo@latest
This installs the binary as river-demo in your Go bin directory.
Quick start
# 1) Run migrations
river-demo migrate
# 2) Start worker (keep running in one terminal)
river-demo work
# 3) Enqueue a successful job
river-demo spawn
# 4) Enqueue a failing job with limited attempts
river-demo spawn --fail --max-attempts 3
Tip: check available flags with:
river-demo --help
river-demo spawn --help