Skip to content

Conversation

@levkk
Copy link
Collaborator

@levkk levkk commented Dec 20, 2025

  • refactor: move sharding key update into its own module
  • BREAKING: sharding key updates require a transaction started by the user instead of starting one automatically
  • feat: support RETURNING clause in UPDATE that changes the sharding key
  • fix: ErrorResponse message incorrectly parsed severity field
  • feat: double-check we actually need to do a multi-step key update when the key isn't actually changed by reading the row from the database

This is common in Rails:

UPDATE orders
SET user_id = $1, amount = $2, created_at = $3,
/* [..every other model field..] */
WHERE id = $1

The sharding key doesn't actually change (user_id), the ORM just puts it into the query anyway.

@blacksmith-sh

This comment has been minimized.

@blacksmith-sh

This comment has been minimized.

@levkk levkk changed the title update rewrite multi: sharding key update improvements + fixes Dec 23, 2025
@levkk levkk marked this pull request as ready for review December 23, 2025 19:09
@levkk levkk changed the title multi: sharding key update improvements + fixes multi: sharding key update improvements + bug fixes Dec 23, 2025
@levkk levkk merged commit 4f5a65b into main Dec 24, 2025
8 checks passed
@levkk levkk deleted the levkk-update-rewrite branch December 24, 2025 04:24
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