kagg-design / kagg-fast-post-generator

Plugin to generate a big number of posts.
GNU General Public License v2.0
18 stars 2 forks source link

SQLite support #17

Open slaFFik opened 8 months ago

slaFFik commented 8 months ago

I tried to lulz your plugin here: https://playground.wordpress.net/?php=7.4&wp=6.4&storage=none&networking=yes

Obviously as expected, it does not work on SQLite.

Given that it looks like SQLite might be merged into core - would you consider adding a support for it?

Super low priority by every possible means.

image
slaFFik commented 8 months ago

BTW, FakerPress works (because it uses native WP functions).

kagg-design commented 8 months ago

The main idea of the plugin is to create a CSV file and use its extremely fast loading with LOAD DATA. It seems that SQLite does not support this MySQL feature. So, I do not see any ability to support SQLite.

As a workaround, it is possible to create a .sql file with the plugin and import it to the SQLite database.

slaFFik commented 8 months ago

Yep, and imo this could be a default fallback approach. So, you check whether the LOAD DATA is available, if not - create an SQL file (maybe in chunks, so several files) and then run $wpdb->query() or whatever. This way it theoretically will cover all cases.