Problem/Motivation

Connection::queryTemporary() is not used anywhere in Core, and has very limited usage in contrib (most are db driver implementations).

Implementing it in db drivers is not straightforward, either - for instance in SQLite it is necessary to tamper with the table prefix array, and we are trying to remove table-level prefixes in other issues. Oracle 11 does not have session-level temporary tables, so workarounds are needed.

Proposed resolution

Deprecate Connection::queryTemporary() for removal in Drupal10.

Remaining tasks

None

User interface changes

None

API changes

The method Drupal\Core\Database\Connection::queryTemporary() and the internal method Drupal\Core\Database\Connection::generateTemporaryTableName() are deprecated.

Data model changes

None

Release notes snippet

None

Issue fork drupal-3211780

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mondrake created an issue. See original summary.

mondrake’s picture

Status: Active » Needs review

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

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

daffie’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

I agree with you @mondrake. Lets deprecate this functionality.

The method Drupal\Core\Database\Connection::generateTemporaryTableName() is a protected method, therefore it is considered as internal and not part of the public API. It does not have to be deprecated. Only it is used by contrib database drivers. Maybe better to do the deprecation and keep the change.

I have updated the CR and the IS.
It all looks good to me.
For me it is RTBC.

mondrake’s picture

Thanks for CR and IS updates, @daffie

catch’s picture

Status: Reviewed & tested by the community » Fixed

Makes sense to deprecate this in its own right, as well as unblocking per-table prefixes.

Committed 32f7a69 and pushed to 9.3.x. Thanks!

  • catch committed a35df16 on 9.3.x
    Issue #3211780 by mondrake, daffie: Deprecate Connection::queryTemporary...

Status: Fixed » Closed (fixed)

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

japerry’s picture

For those who may land on this issue -- It was reverted in Drupal 9.4.x and 10.0.x See https://www.drupal.org/project/drupal/issues/3312641