[TASK] Centralize DB queries

In order to be able to easier debug stuff and intercept database calls,
all queries are made through a central ``query()`` method in
``DatabaseConnection``.

Change-Id: I53cd98dbb837232765bcc24e30851f99d3cfdca0
Resolves: #55769
Releases: 6.2
Reviewed-on: https://review.typo3.org/27420
Reviewed-by: Stefan Neufeind
Reviewed-by: Pascal Dürsteler
Tested-by: Pascal Dürsteler
Reviewed-by: Oliver Klee
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn