Skip to content

refactor(queue)!: own the redis connection instead of borrowing one - #61

Merged
juicycleff merged 1 commit into
mainfrom
chore/queue-drop-database-redis
Aug 18, 2026
Merged

refactor(queue)!: own the redis connection instead of borrowing one#61
juicycleff merged 1 commit into
mainfrom
chore/queue-drop-database-redis

Conversation

@juicycleff

Copy link
Copy Markdown
Contributor

Groundwork for removing extensions/database. This was the last real compile-time dependency on it outside the extension itself.

What it was doing

The queue extension imported the database extension for exactly one reason. When DatabaseRedisConnection was set, it pulled a Redis client out of the database manager's pool instead of dialling its own:

dbManager, err := forge.InjectType[*database.DatabaseManager](container)
redisClient, err := dbManager.Redis(cfg.DatabaseRedisConnection)
queue, err = NewRedisQueueWithClient(cfg, logger, metrics, redisClient)

Note what that is: not a database, a Redis connection it borrowed from something that happened to hold one.

Why it is removed rather than migrated

It cannot move to grove. Grove has no Redis driver. It ships clickhouse, elasticsearch, mongo, mysql, postgres, sqlite and turso, and that is the whole list. There is nothing to point the borrowing at.

So the borrowing goes. NewRedisQueue already dialled its own connection and that path is now the only one, which is how every other driver in this extension already worked.

What changed

  • extension.go: the import, the fail-fast check, and the borrowed-client branch are gone. Dependencies() now returns nil, because the queue owns every connection it uses.
  • config.go: DatabaseRedisConnection, WithDatabaseRedisConnection, and the two validation branches that existed to let Redis skip url/hosts.
  • redis.go: NewRedisQueue's guard no longer accepts a database connection as a substitute for url or hosts.
  • go.mod: the require and the replace ../database.
  • Three docs pages, plus the three tests that only covered the removed option.

Verification

go build, go vet and gofmt are clean. The suite passes apart from TestNATSQueue_PublishConsume, which needs a live NATS broker. I confirmed that one fails identically on unmodified main, so it is not from this change.

Breaking change

database_redis_connection is removed. If you were sharing a Redis connection with the database extension, give the queue its own url or hosts.

Not included

extensions/database still exists. Removing it also needs the CLI work in chore/cli-grove-migration and a decision about the nine model base types forge generate model emits, which have no grove equivalent.

The queue extension imported the database extension for one reason: when
DatabaseRedisConnection was set it pulled a Redis client out of the database
manager's pool rather than dialling its own. That was the last real compile
time dependency on extensions/database outside the extension itself.

It cannot move to grove, because grove has no Redis driver. It ships
clickhouse, elasticsearch, mongo, mysql, postgres, sqlite and turso, and that
is the whole list. So the borrowing goes rather than moves.

Nothing else had to change. NewRedisQueue already dialled its own connection,
and that path is now the only one. Configure Redis under the queue's own url
or hosts the way every other driver here already works.

BREAKING CHANGE: the database_redis_connection option is removed, along with
WithDatabaseRedisConnection and Config.DatabaseRedisConnection. If you were
sharing a Redis connection with the database extension, give the queue its own
url or hosts. Queue now declares no extension dependencies at all.
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
forge Ready Ready Preview Aug 18, 2026 1:33pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

Conventional Commits Validation

PR Title: valid
Commits: all 1 follow conventional format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant