Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract database specific helper methods to PDO adapter #19648

Open
bx80 opened this issue Aug 19, 2022 · 0 comments
Open

Abstract database specific helper methods to PDO adapter #19648

bx80 opened this issue Aug 19, 2022 · 0 comments
Assignees
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Comments

@bx80
Copy link
Contributor

bx80 commented Aug 19, 2022

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.

@bx80 bx80 added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Aug 19, 2022
@bx80 bx80 self-assigned this Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants