Skip to content

feat: add InitializeSchema option to delayed requeuer publisher and subscriber configs#57

Merged
m110 merged 3 commits intoThreeDotsLabs:masterfrom
AdrianZajkowski:feature/delayed_requeuer_initializeschema_option
Mar 23, 2026
Merged

feat: add InitializeSchema option to delayed requeuer publisher and subscriber configs#57
m110 merged 3 commits intoThreeDotsLabs:masterfrom
AdrianZajkowski:feature/delayed_requeuer_initializeschema_option

Conversation

@AdrianZajkowski
Copy link
Copy Markdown
Contributor

@AdrianZajkowski AdrianZajkowski commented Mar 23, 2026

Motivation / Background

Currently, the delayed publisher/subscriber for both PostgreSQL and MySQL always attempts to automatically initialize the database schema (CREATE TABLE). This causes issues in production environments where the database user has restricted permissions and cannot create tables.
This change adds an InitializeSchema configuration option that allows users to disable automatic schema initialization when needed.

Details

Added InitializeSchema field to:

  • DelayedMySQLPublisherConfig
  • DelayedMySQLSubscriberConfig
  • DelayedPostgreSQLPublisherConfig
  • DelayedPostgreSQLSubscriberConfig
  • DelayedRequeuerConfig

Changed hardcoded AutoInitializeSchema: true / InitializeSchema: true to use the config value instead
The option is propagated through the requeuer to its internal publisher and subscriber

Alternative approaches considered (if applicable)

Alternative approach could be to change name from InitializeSchema to DisableInitializeSchema to be backwards compatible if someone currently depends on auto initialize.

I used InitializeSchema to be consistent with naming in other files.

Checklist

The resources of our team are limited. There are a couple of things that you can do to help us merge your PR faster:

  • I wrote tests for the changes.
  • All tests are passing.
    • If you are testing a Pub/Sub, you can start Docker with make up.
    • You can start with make test_short for a quick check.
    • If you want to run all tests, use make test.
  • Code has no breaking changes.
  • (If applicable) documentation on watermill.io is updated.

…figs

This allows disabling automatic schema initialization for environments
where the database user doesn't have CREATE TABLE permissions.
@m110 m110 merged commit 3dfe5f8 into ThreeDotsLabs:master Mar 23, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants