Skip to content

Conversation

@kunal-10-cloud
Copy link

Fixes #5084

Problem
The TypeScript types for onConflictDoUpdate's set clause did not allow sql.placeholder values, even though they work correctly at runtime. This prevented users from using placeholders in upsert operations with prepared statements.

Solution
Added Placeholder to the SQLiteUpdateSetSource type definition in src/sqlite-core/query-builders/update.ts

Changes
Modified SQLiteUpdateSetSource type to include | Placeholder in the union type
Added type test type-tests/sqlite/issue-5084.ts to verify the fix

Testing
Created a reproduction test case in type-tests/sqlite/issue-5084.ts that verifies sql.placeholder can now be used in
onConflictDoUpdate set clause
Verified locally by running npm run test:types
Confirmed the test fails without the fix and passes with the fix

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]: Types do not allow for placeholder usage in onConflictDoUpdate.set

1 participant