Skip to content

Abstract database specific helper methods to PDO adapter #19648

@bx80

Description

@bx80

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.

Metadata

Metadata

Assignees

Labels

EnhancementFor new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions