Skip to content

Commit

Permalink
Add support for selecting journal mode
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Jul 25, 2024
1 parent 5a2576b commit dd911f5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wp-includes/sqlite/class-wp-sqlite-translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,11 @@ public function __construct( $pdo = null ) {
$this->pdo->query( 'PRAGMA foreign_keys = ON' );
}
$this->pdo->query( 'PRAGMA encoding="UTF-8";' );

$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 );
}
}

/**
Expand Down

0 comments on commit dd911f5

Please sign in to comment.