How to enable WAL journaling? #161
Unanswered
johanneswk
asked this question in
Q&A
Replies: 1 comment
-
|
maybe we can set a variable like:
or: add_action( 'plugins_loaded', function() {
global $wpdb;
// Ensure we are actually using the SQLite implementation
if ( ! method_exists( $wpdb, 'db_connect' ) ) {
return;
}
// Set WAL Mode (Permanent - only needs to be run once, but safe to repeat)
$wpdb->query( "PRAGMA journal_mode=WAL;" );
// Set Busy Timeout (Connection-specific)
$wpdb->query( "PRAGMA busy_timeout=5000;" );
// Set Cache Size (Connection-specific)
$wpdb->query( "PRAGMA cache_size=10000;" );
}, 1 ); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have found the following code in class-wp-sqlite-translator:
$valid_journal_modes = array( 'DELETE', 'TRUNCATE', 'PERSIST', 'MEMORY', 'WAL', 'OFF' ); if ( defined( 'SQLITE_JOURNAL_MODE' ) && in_array( SQLITE_JOURNAL_MODE, $valid_journal_modes, true ) ) { $this->pdo->query( 'PRAGMA journal_mode = ' . SQLITE_JOURNAL_MODE ); }Where can I set this variable to SQLITE_JOURNAL_MODE = WAL? Is there a file for these variables?
Beta Was this translation helpful? Give feedback.
All reactions