See #2924316: Support for database drivers for prior discussion.

I filed https://github.com/composer/installers/pull/452 for drupal-database-driver to be added as an installer type.

In this issue, let's add the installation path for it to the composer templates in core's codebase.

Comments

effulgentsia created an issue. See original summary.

mondrake’s picture

jungle’s picture

+++ b/composer/Template/LegacyProject/composer.json
@@ -44,6 +44,7 @@
             "themes/contrib/{$name}": ["type:drupal-theme"],
+            "drivers/lib/Drupal/Driver/Database/{$name}/": ["type:drupal-database-driver"],
             "drush/Commands/contrib/{$name}": ["type:drupal-drush"],

+++ b/composer/Template/RecommendedProject/composer.json
@@ -43,6 +43,7 @@
             "web/themes/contrib/{$name}": ["type:drupal-theme"],
+            "web/drivers/lib/Drupal/Driver/Database/{$name}/": ["type:drupal-database-driver"],
             "drush/Commands/contrib/{$name}": ["type:drupal-drush"],

Hi, Is the trail / after {$name} necessary?

effulgentsia’s picture

Good catch. We should be consistent. This fixes that.

effulgentsia’s picture

Issue tags: +beta target
effulgentsia’s picture

By the way, it would be helpful for this to be committed even if the upstream PR isn't merged yet. Because once this is committed, projects that want to benefit from it prior to the PR getting merged could do so via composer-installers-extender.

alexpott’s picture

I don't think this is the way to go. This would require existing drivers

  • to change their folder structure - Both https://git.drupalcode.org/project/sqlsrv and https://www.drupal.org/project/mongodb will not work
  • There is no concept of a driver for drupal.org to detect and add this type to the composer facade so existing drivers need to add this to their composer.json
  • The structure a driver would have to use is yet another structure to learn - no src directory and a very weird layout.
  • If the driver also has module code then it need to be broken into two projects on drupal.org
effulgentsia’s picture

Status: Needs review » Postponed
Issue tags: -beta target

Postponing on #3120096: Support contrib database driver directories in a fixed location in a module, and possibly makes sense to won't fix after that. Also removing it as a beta target, because I discovered that drivers that override the same name as a core driver don't actually need to be in the drivers directory, they only need to be in the autoloader, so this works.

Drivers with new names need to get discovered by drupal_get_database_types(), so either need to be in the drivers directory, or #3120096: Support contrib database driver directories in a fixed location in a module can improve that.

fgm’s picture

For the mongodb case, we really have two different situations: 8.x-1.x is the precursor to @daffie's version, which has no users and can therefore be restructured as needed, and this is the one which can take advantage of the current contrib driver work. The current stable version, 8.x-2.x, does not attempt to be a database driver anyway: it just adds independent extra services (including storage services), so I think you can just ignore it unless the database notion becomes much wider than it currently is.

Version: 9.0.x-dev » 9.1.x-dev

Drupal 9.0.10 was released on December 3, 2020 and is the final full bugfix release for the Drupal 9.0.x series. Drupal 9.0.x will not receive any further development aside from security fixes. Sites should update to Drupal 9.1.0 to continue receiving regular bugfixes.

Drupal-9-only bug reports should be targeted for the 9.1.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.2.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.1.x-dev » 9.3.x-dev

Drupal 9.1.10 (June 4, 2021) and Drupal 9.2.10 (November 24, 2021) were the last bugfix releases of those minor version series. Drupal 9 bug reports should be targeted for the 9.3.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

effulgentsia’s picture

Status: Postponed » Closed (outdated)

Per https://www.drupal.org/node/3126810, this is now outdated.