Skip to content

fix: make postgres table name configurable via pg_table_name config#568

Open
evanh wants to merge 1 commit intomainfrom
evanh/fix/configurable-table-name
Open

fix: make postgres table name configurable via pg_table_name config#568
evanh wants to merge 1 commit intomainfrom
evanh/fix/configurable-table-name

Conversation

@evanh
Copy link
Member

@evanh evanh commented Mar 6, 2026

There is an idea to have separate tables when using postgres, to isolate some of the work. Make that configurable.

  • Adds pg_table_name config field (defaults to inflight_taskactivations for backwards compatibility)
  • Migration SQL uses a {TABLE_NAME} placeholder; build_migrator() substitutes the name at runtime and recomputes SHA-384 checksums so sqlx migration tracking works correctly
  • All queries in PostgresActivationStore use format! with the configured table name instead of a hardcoded string
  • No new dependencies — sha2 was already in Cargo.toml

Test plan

  • cargo build passes
  • All 200 tests pass (cargo test), including both case_1_sqlite and case_2_postgres variants

🤖 Generated with Claude Code

Allow different deployments to use different PostgreSQL table names for
inflight task activations. Migrations use a {TABLE_NAME} placeholder with
runtime substitution and checksum recomputation via sha2. All queries use
format! with the configured table name. Defaults to inflight_taskactivations
for backwards compatibility.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@evanh evanh requested a review from a team as a code owner March 6, 2026 21:30
@evanh
Copy link
Member Author

evanh commented Mar 6, 2026

I don't actually know if this is better than using different databases, which we can already do without any code changes.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@markstory
Copy link
Member

I don't actually know if this is better than using different databases, which we can already do without any code changes.

What are the downsides of using multiple databases? Are they more complex to provision and maintain?

@evanh
Copy link
Member Author

evanh commented Mar 9, 2026

What are the downsides of using multiple databases? Are they more complex to provision and maintain?

They have different connection pools seems to be the main one. Otherwise the main limitation is that you can't query across DBs, but that is not an issue for us.

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.

2 participants