Skip to content

Commit

Permalink
Use a readonly connection to create the dump
Browse files Browse the repository at this point in the history
  • Loading branch information
guvra committed Mar 5, 2024
1 parent 2c62e00 commit 15121c6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Dumper/MysqlDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ private function getDumpSettings(DumperConfig $config): array
$settings['exclude-tables'] = $config->getTablesBlacklist();
$settings['no-data'] = $config->getTablesToTruncate();

// Set readonly session
$settings['init_commands'][] = 'SET SESSION TRANSACTION READ ONLY';

return $settings;
}
}

0 comments on commit 15121c6

Please sign in to comment.