PDO refactoring for code simplification#2522
Conversation
* Automatic prefix when using the syntax `_tableName` * Uniformity: MySQL is now PDO::ATTR_EMULATE_PREPARES = false just like SQLite and PostgreSQL, with consequences such as only one statement per query * Use PDO methods exec(), query(), prepare() + execute() in a more efficient way * Remove auto-update SQL code for versions older than FreshRSS 1.5 (3 years old) * The name of the default category is set in PHP instead of in the DB (simplies SQL and allows changing the name according to the FreshRSS language) * Rename `->bd` to `->pdo` (less of a frenshism, and more informative) * Fix some requests, which were not compatible with MySQL prepared statements
|
|
+ MySQL install
Discussion FreshRSS#2495 (comment) Needed for constant arrays https://www.php.net/manual/en/migration56.new-features.php which will be used in FreshRSS#2522
|
@marienfressinaud Maybe you could have a look at this PR before you leave for vacation, at least its general principles. |
marienfressinaud
left a comment
There was a problem hiding this comment.
Most of these changes are very welcomed 👍 I don't have a lot to say except that I'm not totally comfortable with my review since the PR is quite big. Smaller dedicated PRs or even more focused commits would help a lot :)
Take advantage of PDO->exec() to run multiple statements
Introduced in FreshRSS#2522
(As promised in #2496 . It may seem like a lot, but it is mainly some fairly automatic changes)
_tableName(with backticks)instead of:
As well as writing:
instead of:
PDO::ATTR_EMULATE_PREPARES = falsejust like SQLite and PostgreSQL, with consequences such as only one statement per query. See e.g. https://phpdelusions.net/pdo#emulation->bdto->pdo(less of a frenshism, and more informative)