Skip to content

Revert fallback logic for WHERE clause validation#4

Closed
LeandroLCD with Copilot wants to merge 1 commit into
developfrom
copilot/sub-pr-2-again
Closed

Revert fallback logic for WHERE clause validation#4
LeandroLCD with Copilot wants to merge 1 commit into
developfrom
copilot/sub-pr-2-again

Conversation

Copilot AI commented Nov 18, 2025

Copy link
Copy Markdown

Reverted confusing fallback logic that automatically promoted the first logical operation to the WHERE clause when none was explicitly set. This behavior was non-obvious and changed query semantics silently.

Changes

  • QueryDelete.kt: Removed fallback logic, restored require(where != null) validation
  • QuerySelect.kt: Removed fallback logic, restored require(where != null) validation

Both query builders now enforce explicit WHERE clause specification, making the API behavior clear and predictable.

// Before: First operation silently became WHERE clause
QueryDelete.builder(table)
    .and(field.eq("value"))  // This became WHERE, not AND
    .build()

// After: WHERE must be explicit
QueryDelete.builder(table)
    .where(field.eq("value"))  // Clear intent
    .build()

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Nov 18, 2025
Copilot AI mentioned this pull request Nov 18, 2025
Copilot AI changed the title [WIP] Fix query builder handling of WHERE clauses Revert fallback logic for WHERE clause validation Nov 18, 2025
Copilot AI requested a review from LeandroLCD November 18, 2025 00:08
@LeandroLCD LeandroLCD closed this Dec 9, 2025
@LeandroLCD
LeandroLCD deleted the copilot/sub-pr-2-again branch December 9, 2025 01:01
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