Skip to content

fix(openworkflow): only transform PG column names, not JSON value object keys#368

Merged
jamescmartinez merged 1 commit intomainfrom
fix-to-camel
Mar 5, 2026
Merged

fix(openworkflow): only transform PG column names, not JSON value object keys#368
jamescmartinez merged 1 commit intomainfrom
fix-to-camel

Conversation

@jamescmartinez
Copy link
Contributor

Closes #367

See test or original GH issue for details.

Copilot AI review requested due to automatic review settings March 5, 2026 13:17
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 5, 2026

Open in StackBlitz

npm i https://pkg.pr.new/openworkflowdev/openworkflow/@openworkflow/cli@368
npm i https://pkg.pr.new/openworkflowdev/openworkflow/@openworkflow/dashboard@368
npm i https://pkg.pr.new/openworkflowdev/openworkflow@368

commit: e8ce862

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a Postgres backend bug where enabling postgres.toCamel globally was also mutating keys inside JSONB payloads (e.g., workflow run input), ensuring user-provided JSON keys are preserved exactly as provided.

Changes:

  • Scope Postgres.js transform to apply only to result column names (not JSON value object keys).
  • Add a regression test that verifies uppercase snake_case JSON keys survive create + readback (API and raw DB query).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/openworkflow/postgres/postgres.ts Updates Postgres client creation to transform only column names via transform.column.from.
packages/openworkflow/postgres/backend.test.ts Adds regression coverage for JSON key preservation in workflow run input, both via backend API and direct SQL read.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jamescmartinez jamescmartinez merged commit fd9cd2e into main Mar 5, 2026
14 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.

[Bug] Postgres client using .toCamel() causing JSON keys containing upper snake case to lose their underscores

2 participants