WordPress / sqlite-database-integration

Feature Plugin to add SQLite support to WordPress. Under Development.
GNU General Public License v2.0
202 stars 30 forks source link

Support UPDATE LIMIT #93

Closed kozer closed 2 months ago

kozer commented 2 months ago

Fixes https://github.com/WordPress/sqlite-database-integration/issues/27

Proposal

Wraps WHERE clauses in UPDATE queries in rowid in ( SELECT rowid from ...WHERE...) to support MySQL's LIMIT and ORDER BY clauses that are unsupported in SQLite.

The implementation in trunk was throwing an error when this case occurred. ( For example when a user tries to add Woo plugin ).

image

This pr aims to fix that.

adamziel commented 2 months ago

Thank you @kozer! I left a few minor comments but this looks good otherwise. It would also be lovely to add the same support for the DELETE queries if you wouldn't mind? The LIMIT in those also keeps coming up.

kozer commented 2 months ago

It would also be lovely to add the same support for the DELETE queries if you wouldn't mind? The LIMIT in those also keeps coming up.

Can we proceed with this one, as we consider it a blocker for Studio release, and open a new ticket for the DELETE statement? Feel free to assign it to me. Thank you @adamziel !!

adamziel commented 2 months ago

@kozer nice, getting closer! I went ahead and pushed two failing test cases – let's make sure they work

adamziel commented 2 months ago

I had an idea how to fix those two test cases so I went ahead and did that