-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
The following only works with MySQL
Lines 1019 to 1024 in 0908bf5
| $db_bytes = $wpdb->get_var( | |
| $wpdb->prepare( | |
| 'SELECT SUM(data_length + index_length) FROM information_schema.TABLES where table_schema = %s GROUP BY table_schema;', | |
| DB_NAME | |
| ) | |
| ); |
I don't believe there is a similar way to get the size of a SQLite database, and the preferred method is to just get the size of the .sqlite file itself.
I wonder what the general solution should be to detect SQLite use in wp-cli commands so any new code is consistent across various projects? It could be good to have a helper function to give the current database type and maybe also the location of the .sqlite file if it is SQLite.
Or is this just better left until WordPress adopts SQLite officially and adds a built in method for wbdp?