[ticket/12765] Use db_tools instead of generating queries at moment

https://tracker.phpbb.com/browse/PHPBB3-12765

PHPBB3-12765
Why do you not use `$db_tools = $phpbb_container->get('dbal.tools');` here?