function Connection::queryTemporary
Same name in this branch
- 11.1.x core/modules/pgsql/src/Driver/Database/pgsql/Connection.php \Drupal\pgsql\Driver\Database\pgsql\Connection::queryTemporary()
- 11.1.x core/modules/mysql/src/Driver/Database/mysql/Connection.php \Drupal\mysql\Driver\Database\mysql\Connection::queryTemporary()
Overrides SupportsTemporaryTablesInterface::queryTemporary
File
-
core/
modules/ sqlite/ src/ Driver/ Database/ sqlite/ Connection.php, line 357
Class
- Connection
- SQLite implementation of \Drupal\Core\Database\Connection.
Namespace
Drupal\sqlite\Driver\Database\sqliteCode
public function queryTemporary($query, array $args = [], array $options = []) {
$tablename = 'db_temporary_' . uniqid();
$this->query('CREATE TEMPORARY TABLE ' . $tablename . ' AS ' . $query, $args, $options);
// Temporary tables always live in the temp database, which means that
// they cannot be fully qualified table names since they do not live
// in the main SQLite database. We provide the fully-qualified name
// ourselves to prevent Drupal from applying prefixes.
// @see https://www.sqlite.org/lang_createtable.html
return 'temp.' . $tablename;
}