This class has more than 6000 lines and more than 100 public functions, it does everything related to databases and needs to be broken down. Some ideas that were brought up by @daniel are:
- Migrate transaction management to its own class and interface (T299698)
- Move replication-based stuff to its own class, e.g. getLag()
- Remove legacy cruft from introduction of ResultWrapper: T286694
- Move schema update and related functions to IMaintainableDatabase or DatabaseUpdater (T190396)
- Move SQL building code from Database class to SQLPlatform (T307616)