Skip to content

Conversation

@ryanrasti
Copy link
Owner

No description provided.

@ryanrasti ryanrasti requested a review from Copilot October 27, 2025 23:01
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

This PR adds a fluent API for chaining methods on UPDATE and DELETE queries, allowing for more ergonomic query building. The changes enable developers to chain set(), where(), and returning() methods instead of passing all clauses upfront, while maintaining backward compatibility.

Key Changes:

  • Added chainWhere() utility function to combine multiple where clauses with AND logic
  • Made UPDATE's set clause optional and added chaining methods (set(), where(), returning())
  • Added chaining methods (where(), returning()) to DELETE queries
  • Updated default type parameter for DELETE's USING clause from D to {}

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/grammar/utils.ts Adds chainWhere() helper function for combining where clauses with AND logic
src/grammar/update.ts Makes set clause optional, adds fluent chaining methods, and updates imports
src/grammar/update.test.ts Adds comprehensive test coverage for chained UPDATE operations including execution tests
src/grammar/select.ts Refactors existing where chaining to use new chainWhere() utility
src/grammar/delete.ts Adds fluent chaining methods for DELETE, updates default USING type parameter, and updates imports
src/grammar/delete.test.ts Adds comprehensive test coverage for chained DELETE operations including execution tests

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

export class Delete<
D extends Types.RowLikeStrict = Types.RowLikeStrict,
U extends Types.RowLike = D,
U extends Types.RowLike = {},
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

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

Changing the default type parameter from D to {} is a breaking change that affects existing code. When no USING clause is provided, callers previously received D as the second argument type, but now receive {}. This could break existing type-safe code that relies on this behavior.

Copilot uses AI. Check for mistakes.
@ryanrasti ryanrasti force-pushed the ryan_fluent_update_delete branch from 636264d to 2284e21 Compare October 27, 2025 23:45
@ryanrasti ryanrasti force-pushed the ryan_fluent_update_delete branch from 2284e21 to c392ae9 Compare October 27, 2025 23:47
@ryanrasti ryanrasti merged commit fd2b7d7 into main Oct 28, 2025
2 of 3 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.

2 participants