@bx80 opened this Issue on August 19th 2022 Contributor

Various methods the core/Db and core/DbHelper helper classes execute MySQL specific statements. In order to support alternative databases these statements should be moved to new methods defined in core/Db/AdapterInterface and implemented by the chosen PDO Adapter.

Suggested Approach

  • Review all methods in core/Db and core/DbHelper, identify those which are very specific to MySQL.
  • Create new methods in core/Db/AdapterInterface.
  • Implement the methods in the Matomo standard MySQL PDO driver core/Db/Adapter/Pdo/Mysql.
  • Rework the core/Db and core/DbHelper method to call the new methods on the PDO adapter.
  • This should not in any way change behavior for MySQL.

An example of a MySQL specific helper function is DbHelper::getDefaultCharset()) which fails on TiDB, SingleStore and likely other databases.

Powered by GitHub Issue Mirror