stellarwp / db

A WPDB wrapper and query builder library.
GNU General Public License v2.0
63 stars 6 forks source link

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

Open JasonTheAdams opened 1 year ago

JasonTheAdams commented 1 year ago

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: