Skip to content

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

Description

@JasonTheAdams

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions