Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
d317f6b3
Commit
d317f6b3
authored
Jul 20, 2016
by
alexpott
Browse files
Issue
#2348137
by daffie: Enable WAL journal mode by default for SQLite database
parent
f51a120c
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php
View file @
d317f6b3
...
...
@@ -124,6 +124,16 @@ public static function open(array &$connection_options = array()) {
// Create a user-space case-insensitive collation with UTF-8 support.
$pdo
->
sqliteCreateCollation
(
'NOCASE_UTF8'
,
array
(
'Drupal\Component\Utility\Unicode'
,
'strcasecmp'
));
// Set SQLite init_commands if not already defined. Enable the Write-Ahead
// Logging (WAL) for SQLite. See https://www.drupal.org/node/2348137 and
// https://www.sqlite.org/wal.html.
$connection_options
+=
array
(
'init_commands'
=>
array
(),
);
$connection_options
[
'init_commands'
]
+=
array
(
'wal'
=>
"PRAGMA journal_mode=WAL"
,
);
// Execute sqlite init_commands.
if
(
isset
(
$connection_options
[
'init_commands'
]))
{
$pdo
->
exec
(
implode
(
'; '
,
$connection_options
[
'init_commands'
]));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment