(no title)
bretthopper | 3 years ago
Since WordPress doesn't have a database abstraction, SQLite integration is done by transforming the SQL query strings meant for MySQL. This not only means doing regexp matches with string replacement, but trying to emulate MySQL functions with either SQLite equivalents, or in the worst case, in PHP application code.
smcnally|3 years ago
it’s one file — ‘db.php’ — you swap in for the core file. From there, it’s mostly been seamless. ~20% of the 5k LOC, is “Method to emulate MySQL XXX() function.”
Less than that for query parsing, regex & rewrites
https://github.com/aaemnnosttv/wp-sqlite-db/blob/master/src/...
rawoke083600|3 years ago
ilyt|3 years ago
noahtallen|3 years ago
MuffinFlavored|3 years ago
How hard would it be to "add one"/refactor?
tyingq|3 years ago
Behold: https://github.com/WordPress/WordPress/blob/master/wp-includ...
CharlesW|3 years ago
From a technical POV: This is potentially straightforward if WordPress leverages (and "blesses", for plug-in developers) a proven abstraction layer like Doctrine DBAL that supports both MySQL and SQLite.
From a non-technical POV: There are tens of thousands of WordPress plug-ins, and even updating the top 1,000 that are good/popular will be a multi-year lift.
AdamJacobMuller|3 years ago
To add one? Trivial.
To refactor all of WP core to use it? I could probably do it in a week or two of focused work.
To enable all plugins and wordpress themes to use it? It is, literally, probably a million times more LOC.
bretthopper|3 years ago
unity1001|3 years ago
bombcar|3 years ago
maxloh|3 years ago