4 ms·
There's a WordPress plugin that adds support for SQLite as an alternative to MySQL. The implementation is (to my mind) simply astonishing: they run regular exp
by simonw 4y ago
There's a WordPress plugin that adds support for SQLite as an alternative to MySQL.
The implementation is (to my mind) simply astonishing: they run regular expressions against the SQL to convert it from MySQL dialect to SQLite! https://github.com/aaemnnosttv/wp-sqlite-db/blob/9a5604cce132fac40c3286f92445a2bf887d842e/src/db.php#L2888 https://github.com/aaemnnosttv/wp-sqlite-db/blob/9a5604cce13...
I'm amazed that this works, but apparently it works really well. I would expect it to break the moment it ran into a WordPress plugin that executed custom SQL in a way they hadn't anticipated though.