Problem/Motivation

Another step forward for unit testability would be removing database.inc.

All the functions in database.inc have OOP counterparts in \Drupal\Core\Database\* namespace, except for db_ignore_replica() which is not marked as deprecated.

The various functions in this file are still in use throughout core.

Proposed resolution

Remaining tasks

For D9 release:

  • Remove the functions.
  • Remove the file.

User interface changes

None.

API changes

Deprecate/remove all db_*

Comments

penyaskito’s picture

Issue summary: View changes
jhodgdon’s picture

Issue tags: +DX

I am not sure I agree with this. For DX, it is useful to have these wrappers, for use in hook_update_N() functions going forward.

joelpittet’s picture

I agree with @jhodgdon to the extent that unless \Drupal\Core\Database\* has one-to-one statics I'd opt out on their removal.

penyaskito’s picture

I understand jhogdon concerns, but as developers will already need to learn OOP, IMHO this API (which has one-to-one function->method mapping) won't be a big impact in their DX.

There are one-to-one methods for this, except for db_ignore_replica(), which we can reproduce with a new Database::ignoreReplica() method.

joelpittet’s picture

Well then cool! Just needs a good change record then. Which could be ripped off from your deprecation notices in #2319875: Deprecate all db_* functions I'm on board now:)

penyaskito’s picture

Issue tags: +Kill includes
mile23’s picture

Title: [META] Remove database.inc » [META] Refactor database.inc to an autoloadable class
Version: 8.0.x-dev » 8.1.x-dev
Issue tags: -
Related issues: +#2124069: Convert schema.inc to the update.update_hook_registry service (UpdateHookRegistry)
mile23’s picture

Title: [META] Refactor database.inc to an autoloadable class » [META] Deprecate contents of database.inc
Issue summary: View changes

Rescoping here a little bit since currently database.inc is very simple wrappers around Drupal\Core\Database\Database. Essentially the work has already been done. Yay.

The only exception is the only non-deprecated function in database.inc: db_ignore_replica(), which really should be refactored onto Drupal\Core\Database\Database.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

cilefen’s picture

Issue summary: View changes
cilefen’s picture

I thought we would keep those under #2848161: [meta] Replace calls to deprecated db_*() wrappers, so we have one meta for usages and one meta for documentation.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

andypost’s picture

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

voleger’s picture

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

voleger’s picture

voleger’s picture

andypost’s picture

Sounds it should be fixed!

berdir’s picture

Status: Active » Fixed

Yes!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.