stellarwp / db

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

Feature: use plain SQL to run the Query Builder delete method #4

Open JasonTheAdams opened 2 years ago

JasonTheAdams commented 2 years ago

Right now the QueryBuilder::delete() method uses wpdb::delete() under the hood. This limits us to what that method is capable of. For example, want a WHERE X IN (SELECT...) clause in your delete 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 delete queries.