[codex] Fix Postgres text array cell edits#1527
Conversation
|
Compute preview deployed. Branch: |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
Summary by CodeRabbitBug Fixes
Documentation
Tests
WalkthroughThe PR fixes PostgreSQL text array cell edits when queries are compiled with inline values ( 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
Warning
CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.
Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@data/postgres-core/dml.test.ts`:
- Around line 1235-1265: Add a new test below the existing "supports PostgreSQL
text array updates when parameters are inlined" test that mirrors the same
coverage for the insert flow. Create a test that calls getInsertQuery with a
text array column (arr_col) containing sample data like ["tag1", "tag2",
"tag3"], using the same noParameters: true option, and verify both the generated
SQL snapshot matches the expected inline array casting format and that the data
persists correctly when executed. This ensures getInsertQuery maintains the same
noParameters contract as the existing update test to prevent one-sided
regressions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 48b0dae5-1b43-4a9d-aa44-a5a09f2cfc64
📒 Files selected for processing (5)
.changeset/fix-postgres-text-array-edits.mdFEATURES.mddata/postgres-core/dml.test.tsdata/postgres-core/dml.tsdata/query.ts
Summary
array[...]expressions whennoParameterscompilation is enabled.text[]column to["tag1", "tag2", "tag3"]with inline parameters.Root Cause
ImmediateValuePluginmarks Kysely values as inline literals whennoParametersis enabled. Kysely's Postgres compiler cannot inline a JavaScript array as a single immediate value, so atext[]edit compiled from["tag1", "tag2", "tag3"]threwinvalid immediate value tag1,tag2,tag3before the update query could run.Validation
pnpm vitest --project data data/postgres-core/dml.test.ts; the new regression failed withinvalid immediate value tag1,tag2,tag3before the fix.pnpm vitest --project data data/postgres-core/dml.test.tspnpm typecheckpnpm test:datapnpm lint(passes with existing warning-only lint output)pnpm demo:ppg, then Playwright athttp://localhost:4310: editedorganizations.regions text[]fororg_acmeto[ "tag1", "tag2", "tag3" ], confirmedSave 1 row, saw no save error, and verified the database row persisted as["tag1","tag2","tag3"].