Skip to content

Fix alias case sensitivity for table aliases, improve bindings, support where() closure didn't add any criteria (empty closure) #164

Open
mean-cj wants to merge 6 commits into
skipperbent:v4-releasefrom
mean-cj:v4-release
Open

Fix alias case sensitivity for table aliases, improve bindings, support where() closure didn't add any criteria (empty closure) #164
mean-cj wants to merge 6 commits into
skipperbent:v4-releasefrom
mean-cj:v4-release

Conversation

@mean-cj
Copy link
Copy Markdown

@mean-cj mean-cj commented May 4, 2026

This pull request focuses on improving alias handling and fixing binding issues in the query builder. The most significant changes address how table aliases are managed (removing forced lowercasing), correct how bindings are merged for raw values, and enhance criteria building logic for nested queries.

Alias handling improvements:

  • Stopped forcing lowercase on table aliases in alias method of QueryBuilderHandler and related adapter methods, ensuring aliases retain their original casing throughout query construction. [1] [2] [3]

Binding and criteria logic fixes:

  • Fixed how bindings are merged for Raw values in both doInsert and getUpdateStatement methods in BaseAdapter, ensuring all bindings are properly included using array_merge. [1] [2]
  • whare(function(){ }) Improved criteria building skipping empty closures and removing unnecessary joiners, preventing invalid SQL generation.
->where(function ($q){
   if (isAdmin(true)) {
      $q->where('so.isAdmin', true);
   } else {
   // empty closure
   }
})

Bindings Handling Fixes:

  • Bindings from raw SQL values are now merged correctly using array_merge in both insert and update operations, ensuring all bindings are included and preserving the correct order. [1] [2]

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.

1 participant