Implemented as part of [ENG-10603](https://linear.app/comm/issue/ENG-10603/biggest-risk-factor-out-code-from-databasequeryexecutor)
Follow-up to D14720. After refactoring is finished, we can make it private again. Also, removing unused `closeConnection`.
Depends on D14735