Convert select query extenders to backend-overrideable services

Created on 7 June 2021, about 3 years ago
Updated 12 November 2023, 8 months ago

Problem/Motivation

While working on 📌 Deprecate usage of Connection::getDriverClass for some classes, and use standard autoloading instead Fixed , we came across the fact that Connection::getDriverClass is also used to resolve overrides to select query extenders. This is not easily solvable with direct autoloading because the to-be-overridden class resides outside of the database driver namespaces; also, while the db driver specific classes are all necessarily extensions of the Core\Database ones, the extenders may be freely added by any module.

Proposed resolution

Try using backend-overrideable services, adding a factory for each extender that will then instantiate extender objects.

Remaining tasks

Needs followup, see #58

User interface changes

None

API changes

Using the full class name as the parameter value in the method Drupal\Core\Database\Query\Select::extend() has been deprecated. Also the method Drupal\Core\Database\Connection::getPagerManager() has been deprecated.

Data model changes

None

Release notes snippet

Select query extenders are now managed through backend-overrideable services → . When extending a query, consuming code needs to switch from hardcoding the extension class to calling the extender service with the type of extension required. Contrib and custom database drivers overriding the extenders need to implement their own service. See https://www.drupal.org/node/3218001 →

📌 Task
Status

Needs work

Version

11.0 🔥

Component
Database  →

Last updated about 4 hours ago

  • Maintained by
  • 🇳🇱Netherlands @daffie
Created by

🇮🇹Italy mondrake 🇮🇹

Live updates comments and jobs are added and updated live.
  • Needs framework manager review

    It is used to alert the framework manager core committer(s) that an issue significantly impacts (or has the potential to impact) multiple subsystems or represents a significant change or addition in architecture or public APIs, and their signoff is needed (see the governance policy draft for more information). If an issue significantly impacts only one subsystem, use Needs subsystem maintainer review instead, and make sure the issue component is set to the correct subsystem.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024