Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: use plain SQL to run the Query Builder update method #5

Open
JasonTheAdams opened this issue Sep 28, 2022 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@JasonTheAdams
Copy link

Right now the QueryBuilder::update() method uses wpdb::update() under the hood. This limits us to what that method is capable of. For example, want a WHERE X IN (SELECT...) clause in your update method? Too bad. 😭

By switching to running simple SQL under the hood we make more complex conditions possible without much effort. The WHERE clause is simply converted to SQL and tacked onto the end, getting the full power of the Query Builder behind complex update queries. Furthermore, update can also receive:

  • A Query
  • ORDER BY clause
  • LIMIT clause
@JasonTheAdams JasonTheAdams added the enhancement New feature or request label Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant