From 92286713d58abc1aad1cc55ad7d1a0c59ab758c3 Mon Sep 17 00:00:00 2001
From: Larry Garfield <larry@garfieldtech.com>
Date: Sun, 22 Jan 2012 22:47:08 -0600
Subject: [PATCH] Move database files to the new lib directory and update code
 accordingly.

---
 .../Drupal/Database/Driver/mysql/Delete.php   |  7 ------
 .../Drupal/Database/Driver/mysql/Merge.php    |  7 ------
 .../Drupal/Database/Driver/mysql/Select.php   |  7 ------
 .../Database/Driver/mysql/Transaction.php     |  7 ------
 .../Drupal/Database/Driver/mysql/Update.php   |  7 ------
 .../Drupal/Database/Driver/sqlite/Merge.php   |  7 ------
 .../Database/Driver/sqlite/Transaction.php    |  7 ------
 core/includes/bootstrap.inc                   |  2 +-
 core/includes/common.inc                      |  2 +-
 core/includes/database/database.inc           |  4 ++--
 core/includes/install.core.inc                | 22 ++++++++++++++++---
 core/includes/install.inc                     |  6 ++---
 core/includes/pager.inc                       |  6 ++---
 core/includes/registry.inc                    |  2 +-
 core/includes/tablesort.inc                   |  6 ++---
 .../Drupal/Core}/Database/Connection.php      | 10 ++++-----
 .../ConnectionNotDefinedException.php         |  2 +-
 .../Drupal/Core}/Database/Database.php        |  4 ++--
 .../Database/Driver/mysql/Connection.php      |  8 +++----
 .../Core/Database/Driver/mysql/Delete.php     |  7 ++++++
 .../Core}/Database/Driver/mysql/Insert.php    |  4 ++--
 .../Database/Driver/mysql/Install/Tasks.php   |  4 ++--
 .../Core/Database/Driver/mysql/Merge.php      |  7 ++++++
 .../Core}/Database/Driver/mysql/Schema.php    | 12 +++++-----
 .../Core/Database/Driver/mysql/Select.php     |  7 ++++++
 .../Database/Driver/mysql/Transaction.php     |  7 ++++++
 .../Core}/Database/Driver/mysql/Truncate.php  |  4 ++--
 .../Core/Database/Driver/mysql/Update.php     |  7 ++++++
 .../Database/Driver/pgsql/Install/Tasks.php   |  4 ++--
 .../Database/Driver/sqlite/Connection.php     | 16 +++++++-------
 .../Core}/Database/Driver/sqlite/Delete.php   |  4 ++--
 .../Core}/Database/Driver/sqlite/Insert.php   |  4 ++--
 .../Database/Driver/sqlite/Install/Tasks.php  |  4 ++--
 .../Core/Database/Driver/sqlite/Merge.php     |  7 ++++++
 .../Core}/Database/Driver/sqlite/Schema.php   |  8 +++----
 .../Core}/Database/Driver/sqlite/Select.php   |  4 ++--
 .../Database/Driver/sqlite/Statement.php      |  6 ++---
 .../Database/Driver/sqlite/Transaction.php    |  7 ++++++
 .../Core}/Database/Driver/sqlite/Truncate.php |  4 ++--
 .../Core}/Database/Driver/sqlite/Update.php   |  8 +++----
 .../Database/DriverNotSpecifiedException.php  |  2 +-
 .../Core}/Database/Install/TaskException.php  |  2 +-
 .../Drupal/Core}/Database/Install/Tasks.php   |  4 ++--
 .../Drupal/Core}/Database/Log.php             |  2 +-
 .../Database/Query/AlterableInterface.php     |  2 +-
 .../Drupal/Core}/Database/Query/Condition.php |  4 ++--
 .../Database/Query/ConditionInterface.php     |  4 ++--
 .../Drupal/Core}/Database/Query/Delete.php    |  6 ++---
 .../Database/Query/ExtendableInterface.php    |  2 +-
 .../Database/Query/FieldsOverlapException.php |  2 +-
 .../Drupal/Core}/Database/Query/Insert.php    |  4 ++--
 .../Query/InvalidMergeQueryException.php      |  2 +-
 .../Drupal/Core}/Database/Query/Merge.php     |  6 ++---
 .../Database/Query/NoFieldsException.php      |  2 +-
 .../Database/Query/PlaceholderInterface.php   |  2 +-
 .../Drupal/Core}/Database/Query/Query.php     |  6 ++---
 .../Drupal/Core}/Database/Query/Select.php    |  6 ++---
 .../Core}/Database/Query/SelectExtender.php   |  4 ++--
 .../Core}/Database/Query/SelectInterface.php  |  2 +-
 .../Drupal/Core}/Database/Query/Truncate.php  |  6 ++---
 .../Drupal/Core}/Database/Query/Update.php    |  6 ++---
 .../Drupal/Core}/Database/Schema.php          |  8 +++----
 .../Drupal/Core}/Database/SchemaException.php |  2 +-
 .../SchemaObjectDoesNotExistException.php     |  2 +-
 .../Database/SchemaObjectExistsException.php  |  2 +-
 .../Drupal/Core}/Database/StatementBase.php   |  2 +-
 .../Drupal/Core}/Database/StatementEmpty.php  |  2 +-
 .../Core}/Database/StatementInterface.php     |  2 +-
 .../Core}/Database/StatementPrefetch.php      |  4 ++--
 .../Drupal/Core}/Database/Transaction.php     |  2 +-
 .../TransactionCommitFailedException.php      |  2 +-
 .../Core}/Database/TransactionException.php   |  2 +-
 ...ctionExplicitCommitNotAllowedException.php |  2 +-
 .../TransactionNameNonUniqueException.php     |  2 +-
 .../Database/TransactionNoActiveException.php |  2 +-
 .../TransactionOutOfOrderException.php        |  2 +-
 core/modules/dblog/dblog.module               |  2 +-
 core/modules/entity/entity.query.inc          |  2 +-
 .../field_sql_storage.module                  |  4 ++--
 .../field_sql_storage/field_sql_storage.test  |  2 +-
 core/modules/node/node.admin.inc              |  2 +-
 core/modules/node/node.module                 |  6 ++---
 core/modules/node/node.test                   |  2 +-
 core/modules/search/search.extender.inc       |  4 ++--
 .../simpletest/drupal_web_test_case.php       |  4 ++--
 core/modules/simpletest/simpletest.module     |  2 +-
 .../simpletest/tests/database_test.module     |  2 +-
 .../simpletest/tests/database_test.test       | 16 +++++++-------
 core/modules/simpletest/tests/schema.test     |  2 +-
 .../simpletest/tests/upgrade/upgrade.test     |  2 +-
 core/modules/system/system.install            |  2 +-
 core/modules/system/system.test               |  2 +-
 core/modules/user/user.module                 |  2 +-
 93 files changed, 223 insertions(+), 207 deletions(-)
 delete mode 100644 core/includes/Drupal/Database/Driver/mysql/Delete.php
 delete mode 100644 core/includes/Drupal/Database/Driver/mysql/Merge.php
 delete mode 100644 core/includes/Drupal/Database/Driver/mysql/Select.php
 delete mode 100644 core/includes/Drupal/Database/Driver/mysql/Transaction.php
 delete mode 100644 core/includes/Drupal/Database/Driver/mysql/Update.php
 delete mode 100644 core/includes/Drupal/Database/Driver/sqlite/Merge.php
 delete mode 100644 core/includes/Drupal/Database/Driver/sqlite/Transaction.php
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Connection.php (99%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/ConnectionNotDefinedException.php (84%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Database.php (99%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Driver/mysql/Connection.php (97%)
 create mode 100644 core/lib/Drupal/Core/Database/Driver/mysql/Delete.php
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Driver/mysql/Insert.php (96%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Driver/mysql/Install/Tasks.php (83%)
 create mode 100644 core/lib/Drupal/Core/Database/Driver/mysql/Merge.php
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Driver/mysql/Schema.php (98%)
 create mode 100644 core/lib/Drupal/Core/Database/Driver/mysql/Select.php
 create mode 100644 core/lib/Drupal/Core/Database/Driver/mysql/Transaction.php
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Driver/mysql/Truncate.php (86%)
 create mode 100644 core/lib/Drupal/Core/Database/Driver/mysql/Update.php
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Driver/pgsql/Install/Tasks.php (98%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Driver/sqlite/Connection.php (97%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Driver/sqlite/Delete.php (88%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Driver/sqlite/Insert.php (92%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Driver/sqlite/Install/Tasks.php (93%)
 create mode 100644 core/lib/Drupal/Core/Database/Driver/sqlite/Merge.php
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Driver/sqlite/Schema.php (99%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Driver/sqlite/Select.php (62%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Driver/sqlite/Statement.php (97%)
 create mode 100644 core/lib/Drupal/Core/Database/Driver/sqlite/Transaction.php
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Driver/sqlite/Truncate.php (83%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Driver/sqlite/Update.php (91%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/DriverNotSpecifiedException.php (84%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Install/TaskException.php (77%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Install/Tasks.php (99%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Log.php (99%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Query/AlterableInterface.php (98%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Query/Condition.php (99%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Query/ConditionInterface.php (98%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Query/Delete.php (97%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Query/ExtendableInterface.php (96%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Query/FieldsOverlapException.php (88%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Query/Insert.php (99%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Query/InvalidMergeQueryException.php (89%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Query/Merge.php (99%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Query/NoFieldsException.php (80%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Query/PlaceholderInterface.php (90%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Query/Query.php (97%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Query/Select.php (99%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Query/SelectExtender.php (99%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Query/SelectInterface.php (99%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Query/Truncate.php (93%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Query/Update.php (98%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Schema.php (99%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/SchemaException.php (80%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/SchemaObjectDoesNotExistException.php (91%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/SchemaObjectExistsException.php (90%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/StatementBase.php (98%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/StatementEmpty.php (98%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/StatementInterface.php (99%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/StatementPrefetch.php (99%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/Transaction.php (98%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/TransactionCommitFailedException.php (81%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/TransactionException.php (82%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/TransactionExplicitCommitNotAllowedException.php (90%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/TransactionNameNonUniqueException.php (83%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/TransactionNoActiveException.php (83%)
 rename core/{includes/Drupal => lib/Drupal/Core}/Database/TransactionOutOfOrderException.php (84%)

diff --git a/core/includes/Drupal/Database/Driver/mysql/Delete.php b/core/includes/Drupal/Database/Driver/mysql/Delete.php
deleted file mode 100644
index 5d04ea9db57c..000000000000
--- a/core/includes/Drupal/Database/Driver/mysql/Delete.php
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-
-namespace Drupal\Database\Driver\mysql;
-
-use Drupal\Database\Query\Delete as QueryDelete;
-
-class Delete extends QueryDelete { }
diff --git a/core/includes/Drupal/Database/Driver/mysql/Merge.php b/core/includes/Drupal/Database/Driver/mysql/Merge.php
deleted file mode 100644
index 1d75cf2a74a1..000000000000
--- a/core/includes/Drupal/Database/Driver/mysql/Merge.php
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-
-namespace Drupal\Database\Driver\mysql;
-
-use Drupal\Database\Query\Merge as QueryMerge;
-
-class Merge extends QueryMerge { }
diff --git a/core/includes/Drupal/Database/Driver/mysql/Select.php b/core/includes/Drupal/Database/Driver/mysql/Select.php
deleted file mode 100644
index 35ef1d55132b..000000000000
--- a/core/includes/Drupal/Database/Driver/mysql/Select.php
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-
-namespace Drupal\Database\Driver\mysql;
-
-use Drupal\Database\Query\Select as QuerySelect;
-
-class Select extends QuerySelect { }
diff --git a/core/includes/Drupal/Database/Driver/mysql/Transaction.php b/core/includes/Drupal/Database/Driver/mysql/Transaction.php
deleted file mode 100644
index 57e3fb0c2ebb..000000000000
--- a/core/includes/Drupal/Database/Driver/mysql/Transaction.php
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-
-namespace Drupal\Database\Driver\mysql;
-
-use Drupal\Database\Transaction as DatabaseTransaction;
-
-class Transaction extends DatabaseTransaction { }
diff --git a/core/includes/Drupal/Database/Driver/mysql/Update.php b/core/includes/Drupal/Database/Driver/mysql/Update.php
deleted file mode 100644
index 6b82267bc9d7..000000000000
--- a/core/includes/Drupal/Database/Driver/mysql/Update.php
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-
-namespace Drupal\Database\Driver\mysql;
-
-use Drupal\Database\Query\Update as QueryUpdate;
-
-class Update extends QueryUpdate { }
diff --git a/core/includes/Drupal/Database/Driver/sqlite/Merge.php b/core/includes/Drupal/Database/Driver/sqlite/Merge.php
deleted file mode 100644
index f418cbb0aaaa..000000000000
--- a/core/includes/Drupal/Database/Driver/sqlite/Merge.php
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-
-namespace Drupal\Database\Driver\sqlite;
-
-use Drupal\Database\Query\Merge as QueryMerge;
-
-class Merge extends QueryMerge { }
diff --git a/core/includes/Drupal/Database/Driver/sqlite/Transaction.php b/core/includes/Drupal/Database/Driver/sqlite/Transaction.php
deleted file mode 100644
index 856ca7145d62..000000000000
--- a/core/includes/Drupal/Database/Driver/sqlite/Transaction.php
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-
-namespace Drupal\Database\Driver\sqlite;
-
-use Drupal\Database\Transaction as DatabaseTransaction;
-
-class Transaction extends DatabaseTransaction { }
diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 951b11aab342..df0d8c4a6f55 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -1,6 +1,6 @@
 <?php
 
-use Drupal\Database\Database;
+use Drupal\Core\Database\Database;
 use Symfony\Component\ClassLoader\UniversalClassLoader;
 use Symfony\Component\ClassLoader\ApcUniversalClassLoader;
 
diff --git a/core/includes/common.inc b/core/includes/common.inc
index 44f0408b242e..7045e94548f2 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -1,6 +1,6 @@
 <?php
 
-use Drupal\Database\Database;
+use Drupal\Core\Database\Database;
 
 /**
  * @file
diff --git a/core/includes/database/database.inc b/core/includes/database/database.inc
index 60b0d3b9748b..c2df94988ffd 100644
--- a/core/includes/database/database.inc
+++ b/core/includes/database/database.inc
@@ -1,7 +1,7 @@
 <?php
 
-use Drupal\Database\Database;
-use Drupal\Database\Query\Condition;
+use Drupal\Core\Database\Database;
+use Drupal\Core\Database\Query\Condition;
 
 /**
  * @file
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index 886e331fcf4f..992d143d41f8 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -1,7 +1,7 @@
 <?php
 
-use Drupal\Database\Database;
-use Drupal\Database\Install\TaskException;
+use Drupal\Core\Database\Database;
+use Drupal\Core\Database\Install\TaskException;
 
 /**
  * @file
@@ -234,7 +234,23 @@ function install_begin_request(&$install_state) {
 
   // Ensure that the class loader is available so that we can leverage classes
   // as part of the install routine.
-  drupal_initialize_classloader();
+  $loader = drupal_classloader();
+
+  // Register explicit vendor namespaces.
+  $loader->registerNamespaces(array(
+    // All Symfony-borrowed code lives in /core/includes/Symfony.
+    'Symfony' => DRUPAL_ROOT . '/core/vendor',
+  ));
+  // Register the Drupal namespace for classes in core as a fallback.
+  // This allows to register additional namespaces within the Drupal namespace
+  // (e.g., for modules) and avoids an additional file_exists() on the Drupal
+  // core namespace, since the class loader can already determine the best
+  // namespace match based on a string comparison. It further allows modules to
+  // register/overload namespaces in Drupal core.
+  $loader->registerNamespaceFallbacks(array(
+    // All Drupal-namespaced code in core lives in /core/includes/Drupal.
+    'Drupal' => DRUPAL_ROOT . '/core/lib',
+  ));
 
   if (!$install_state['interactive']) {
     drupal_override_server_variables($install_state['server']);
diff --git a/core/includes/install.inc b/core/includes/install.inc
index 19fbdc13df02..8a25693a1c2a 100644
--- a/core/includes/install.inc
+++ b/core/includes/install.inc
@@ -1,6 +1,6 @@
 <?php
 
-use Drupal\Database\Database;
+use Drupal\Core\Database\Database;
 
 /**
  * Indicates that a module has not been installed yet.
@@ -256,7 +256,7 @@ function drupal_get_database_types() {
   // Because we have no registry yet, we need to also include the install.inc
   // file for the driver explicitly.
   require_once DRUPAL_ROOT . '/core/includes/database/database.inc';
-  foreach (file_scan_directory(DRUPAL_ROOT . '/core/includes/Drupal/Database/Driver', '/^[a-z]*$/i', array('recurse' => FALSE)) as $file) {
+  foreach (file_scan_directory(DRUPAL_ROOT . '/core/lib/Drupal/Core/Database/Driver', '/^[a-z]*$/i', array('recurse' => FALSE)) as $file) {
     if (file_exists($file->uri . '/Install/Tasks.php')) {
       $drivers[$file->filename] = $file->uri;
     }
@@ -1006,6 +1006,6 @@ function db_run_tasks($driver) {
 function db_installer_object($driver) {
   // We cannot use Database::getConnection->getDriverClass() here, because
   // the connection object is not yet functional.
-  $task_class = "Drupal\\Database\\Driver\\{$driver}\\Install\\Tasks";
+  $task_class = "Drupal\\Core\\Database\\Driver\\{$driver}\\Install\\Tasks";
   return new $task_class();
 }
diff --git a/core/includes/pager.inc b/core/includes/pager.inc
index 2c71e0b4d7ce..f05a955bc67f 100644
--- a/core/includes/pager.inc
+++ b/core/includes/pager.inc
@@ -1,8 +1,8 @@
 <?php
 
-use Drupal\Database\Connection;
-use Drupal\Database\Query\SelectExtender;
-use Drupal\Database\Query\SelectInterface;
+use Drupal\Core\Database\Connection;
+use Drupal\Core\Database\Query\SelectExtender;
+use Drupal\Core\Database\Query\SelectInterface;
 
 /**
  * @file
diff --git a/core/includes/registry.inc b/core/includes/registry.inc
index 39e391035274..7ac296017942 100644
--- a/core/includes/registry.inc
+++ b/core/includes/registry.inc
@@ -1,6 +1,6 @@
 <?php
 
-use Drupal\Database\Database;
+use Drupal\Core\Database\Database;
 
 /**
  * @file
diff --git a/core/includes/tablesort.inc b/core/includes/tablesort.inc
index d7de7c7fc73e..3c70b965c30a 100644
--- a/core/includes/tablesort.inc
+++ b/core/includes/tablesort.inc
@@ -1,8 +1,8 @@
 <?php
 
-use Drupal\Database\Connection;
-use Drupal\Database\Query\SelectExtender;
-use Drupal\Database\Query\SelectInterface;
+use Drupal\Core\Database\Connection;
+use Drupal\Core\Database\Query\SelectExtender;
+use Drupal\Core\Database\Query\SelectInterface;
 
 /**
  * @file
diff --git a/core/includes/Drupal/Database/Connection.php b/core/lib/Drupal/Core/Database/Connection.php
similarity index 99%
rename from core/includes/Drupal/Database/Connection.php
rename to core/lib/Drupal/Core/Database/Connection.php
index e9df7acda1a5..a0ed3a10a4f3 100644
--- a/core/includes/Drupal/Database/Connection.php
+++ b/core/lib/Drupal/Core/Database/Connection.php
@@ -1,9 +1,9 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
-use Drupal\Database\DatabaseTransactionNoActiveException;
-use Drupal\Database\DatabaseTransactionOutOfOrderException;
+use Drupal\Core\Database\DatabaseTransactionNoActiveException;
+use Drupal\Core\Database\DatabaseTransactionOutOfOrderException;
 
 use PDO;
 use PDOException;
@@ -70,7 +70,7 @@ abstract class Connection extends PDO {
    *
    * @var string
    */
-  protected $statementClass = '\\Drupal\\Database\\StatementBase';
+  protected $statementClass = '\\Drupal\\Core\\Database\\StatementBase';
 
   /**
    * Whether this database connection supports transactions.
@@ -593,7 +593,7 @@ protected function expandArguments(&$query, &$args) {
   public function getDriverClass($class) {
     if (empty($this->driverClasses[$class])) {
       $driver = $this->driver();
-      $driver_class = "Drupal\\Database\\Driver\\{$driver}\\{$class}";
+      $driver_class = "Drupal\\Core\\Database\\Driver\\{$driver}\\{$class}";
       $this->driverClasses[$class] = class_exists($driver_class) ? $driver_class : $class;
     }
     return $this->driverClasses[$class];
diff --git a/core/includes/Drupal/Database/ConnectionNotDefinedException.php b/core/lib/Drupal/Core/Database/ConnectionNotDefinedException.php
similarity index 84%
rename from core/includes/Drupal/Database/ConnectionNotDefinedException.php
rename to core/lib/Drupal/Core/Database/ConnectionNotDefinedException.php
index 42b4196f4b3d..841b9e584a3c 100644
--- a/core/includes/Drupal/Database/ConnectionNotDefinedException.php
+++ b/core/lib/Drupal/Core/Database/ConnectionNotDefinedException.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
 use RuntimeException;
 
diff --git a/core/includes/Drupal/Database/Database.php b/core/lib/Drupal/Core/Database/Database.php
similarity index 99%
rename from core/includes/Drupal/Database/Database.php
rename to core/lib/Drupal/Core/Database/Database.php
index f5ce5077bc3b..02f9684cb6d5 100644
--- a/core/includes/Drupal/Database/Database.php
+++ b/core/lib/Drupal/Core/Database/Database.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
 /**
  * Primary front-controller for the database system.
@@ -371,7 +371,7 @@ final protected static function openConnection($key, $target) {
 
     // We cannot rely on the registry yet, because the registry requires an
     // open database connection.
-    $driver_class = "Drupal\\Database\\Driver\\{$driver}\\Connection";
+    $driver_class = "Drupal\\Core\\Database\\Driver\\{$driver}\\Connection";
     $new_connection = new $driver_class(self::$databaseInfo[$key][$target]);
     $new_connection->setTarget($target);
     $new_connection->setKey($key);
diff --git a/core/includes/Drupal/Database/Driver/mysql/Connection.php b/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php
similarity index 97%
rename from core/includes/Drupal/Database/Driver/mysql/Connection.php
rename to core/lib/Drupal/Core/Database/Driver/mysql/Connection.php
index bbfcd13b60a3..d8cbf4a01b5c 100644
--- a/core/includes/Drupal/Database/Driver/mysql/Connection.php
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php
@@ -1,10 +1,10 @@
 <?php
 
-namespace Drupal\Database\Driver\mysql;
+namespace Drupal\Core\Database\Driver\mysql;
 
-use Drupal\Database\Database;
-use Drupal\Database\DatabaseTransactionCommitFailedException;
-use Drupal\Database\Connection as DatabaseConnection;
+use Drupal\Core\Database\Database;
+use Drupal\Core\Database\DatabaseTransactionCommitFailedException;
+use Drupal\Core\Database\Connection as DatabaseConnection;
 
 use PDO;
 use PDOException;
diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Delete.php b/core/lib/Drupal/Core/Database/Driver/mysql/Delete.php
new file mode 100644
index 000000000000..0fc846bc3305
--- /dev/null
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Delete.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace Drupal\Core\Database\Driver\mysql;
+
+use Drupal\Core\Database\Query\Delete as QueryDelete;
+
+class Delete extends QueryDelete { }
diff --git a/core/includes/Drupal/Database/Driver/mysql/Insert.php b/core/lib/Drupal/Core/Database/Driver/mysql/Insert.php
similarity index 96%
rename from core/includes/Drupal/Database/Driver/mysql/Insert.php
rename to core/lib/Drupal/Core/Database/Driver/mysql/Insert.php
index ff58f3ba5ab0..2564ba0b104c 100644
--- a/core/includes/Drupal/Database/Driver/mysql/Insert.php
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Insert.php
@@ -1,8 +1,8 @@
 <?php
 
-namespace Drupal\Database\Driver\mysql;
+namespace Drupal\Core\Database\Driver\mysql;
 
-use Drupal\Database\Query\Insert as QueryInsert;
+use Drupal\Core\Database\Query\Insert as QueryInsert;
 
 class Insert extends QueryInsert {
 
diff --git a/core/includes/Drupal/Database/Driver/mysql/Install/Tasks.php b/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php
similarity index 83%
rename from core/includes/Drupal/Database/Driver/mysql/Install/Tasks.php
rename to core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php
index 1ff32741922f..73a864050545 100644
--- a/core/includes/Drupal/Database/Driver/mysql/Install/Tasks.php
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php
@@ -1,8 +1,8 @@
 <?php
 
-namespace Drupal\Database\Driver\mysql\Install;
+namespace Drupal\Core\Database\Driver\mysql\Install;
 
-use Drupal\Database\Install\Tasks as InstallTasks;
+use Drupal\Core\Database\Install\Tasks as InstallTasks;
 
 /**
  * Specifies installation tasks for MySQL and equivalent databases.
diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Merge.php b/core/lib/Drupal/Core/Database/Driver/mysql/Merge.php
new file mode 100644
index 000000000000..f533b76c06b8
--- /dev/null
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Merge.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace Drupal\Core\Database\Driver\mysql;
+
+use Drupal\Core\Database\Query\Merge as QueryMerge;
+
+class Merge extends QueryMerge { }
diff --git a/core/includes/Drupal/Database/Driver/mysql/Schema.php b/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php
similarity index 98%
rename from core/includes/Drupal/Database/Driver/mysql/Schema.php
rename to core/lib/Drupal/Core/Database/Driver/mysql/Schema.php
index 6c9e060f82b7..8bcab069c49e 100644
--- a/core/includes/Drupal/Database/Driver/mysql/Schema.php
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php
@@ -1,12 +1,12 @@
 <?php
 
-namespace Drupal\Database\Driver\mysql;
+namespace Drupal\Core\Database\Driver\mysql;
 
-use Drupal\Database\Database;
-use Drupal\Database\Query\Condition;
-use Drupal\Database\SchemaObjectExistsException;
-use Drupal\Database\SchemaObjectDoesNotExistException;
-use Drupal\Database\Schema as DatabaseSchema;
+use Drupal\Core\Database\Database;
+use Drupal\Core\Database\Query\Condition;
+use Drupal\Core\Database\SchemaObjectExistsException;
+use Drupal\Core\Database\SchemaObjectDoesNotExistException;
+use Drupal\Core\Database\Schema as DatabaseSchema;
 
 use Exception;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Select.php b/core/lib/Drupal/Core/Database/Driver/mysql/Select.php
new file mode 100644
index 000000000000..5cad6165baac
--- /dev/null
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Select.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace Drupal\Core\Database\Driver\mysql;
+
+use Drupal\Core\Database\Query\Select as QuerySelect;
+
+class Select extends QuerySelect { }
diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Transaction.php b/core/lib/Drupal/Core/Database/Driver/mysql/Transaction.php
new file mode 100644
index 000000000000..65b7d5eb4e12
--- /dev/null
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Transaction.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace Drupal\Core\Database\Driver\mysql;
+
+use Drupal\Core\Database\Transaction as DatabaseTransaction;
+
+class Transaction extends DatabaseTransaction { }
diff --git a/core/includes/Drupal/Database/Driver/mysql/Truncate.php b/core/lib/Drupal/Core/Database/Driver/mysql/Truncate.php
similarity index 86%
rename from core/includes/Drupal/Database/Driver/mysql/Truncate.php
rename to core/lib/Drupal/Core/Database/Driver/mysql/Truncate.php
index 40c49cd35f6a..0ab287722c50 100644
--- a/core/includes/Drupal/Database/Driver/mysql/Truncate.php
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Truncate.php
@@ -1,8 +1,8 @@
 <?php
 
-namespace Drupal\Database\Driver\mysql;
+namespace Drupal\Core\Database\Driver\mysql;
 
-use Drupal\Database\Query\Truncate as QueryTruncate;
+use Drupal\Core\Database\Query\Truncate as QueryTruncate;
 
 class Truncate extends QueryTruncate {
   public function __toString() {
diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Update.php b/core/lib/Drupal/Core/Database/Driver/mysql/Update.php
new file mode 100644
index 000000000000..f781891bc3b0
--- /dev/null
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Update.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace Drupal\Core\Database\Driver\mysql;
+
+use Drupal\Core\Database\Query\Update as QueryUpdate;
+
+class Update extends QueryUpdate { }
diff --git a/core/includes/Drupal/Database/Driver/pgsql/Install/Tasks.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php
similarity index 98%
rename from core/includes/Drupal/Database/Driver/pgsql/Install/Tasks.php
rename to core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php
index d819903e528b..6e5faeb289a0 100644
--- a/core/includes/Drupal/Database/Driver/pgsql/Install/Tasks.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php
@@ -1,8 +1,8 @@
 <?php
 
-namespace Drupal\Database\Driver\pgsql\Install;
+namespace Drupal\Core\Database\Driver\pgsql\Install;
 
-use Drupal\Database\Install\Tasks as InstallTasks;
+use Drupal\Core\Database\Install\Tasks as InstallTasks;
 
 /**
  * PostgreSQL specific install functions
diff --git a/core/includes/Drupal/Database/Driver/sqlite/Connection.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php
similarity index 97%
rename from core/includes/Drupal/Database/Driver/sqlite/Connection.php
rename to core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php
index bed87871de1c..a0a976942ae5 100644
--- a/core/includes/Drupal/Database/Driver/sqlite/Connection.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php
@@ -1,13 +1,13 @@
 <?php
 
-namespace Drupal\Database\Driver\sqlite;
-
-use Drupal\Database\Database;
-use Drupal\Database\TransactionNoActiveException;
-use Drupal\Database\TransactionNameNonUniqueException;
-use Drupal\Database\TransactionCommitFailedException;
-use Drupal\Database\Driver\sqlite\Statement;
-use Drupal\Database\Connection as DatabaseConnection;
+namespace Drupal\Core\Database\Driver\sqlite;
+
+use Drupal\Core\Database\Database;
+use Drupal\Core\Database\TransactionNoActiveException;
+use Drupal\Core\Database\TransactionNameNonUniqueException;
+use Drupal\Core\Database\TransactionCommitFailedException;
+use Drupal\Core\Database\Driver\sqlite\Statement;
+use Drupal\Core\Database\Connection as DatabaseConnection;
 
 use PDO;
 use Exception;
diff --git a/core/includes/Drupal/Database/Driver/sqlite/Delete.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Delete.php
similarity index 88%
rename from core/includes/Drupal/Database/Driver/sqlite/Delete.php
rename to core/lib/Drupal/Core/Database/Driver/sqlite/Delete.php
index 2270149c7f6b..db0d79b606e8 100644
--- a/core/includes/Drupal/Database/Driver/sqlite/Delete.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Delete.php
@@ -1,8 +1,8 @@
 <?php
 
-namespace Drupal\Database\Driver\sqlite;
+namespace Drupal\Core\Database\Driver\sqlite;
 
-use Drupal\Database\Query\Delete as QueryDelete;
+use Drupal\Core\Database\Query\Delete as QueryDelete;
 
 /**
  * SQLite specific implementation of DeleteQuery.
diff --git a/core/includes/Drupal/Database/Driver/sqlite/Insert.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Insert.php
similarity index 92%
rename from core/includes/Drupal/Database/Driver/sqlite/Insert.php
rename to core/lib/Drupal/Core/Database/Driver/sqlite/Insert.php
index 22e794455f50..5f39ab41fed2 100644
--- a/core/includes/Drupal/Database/Driver/sqlite/Insert.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Insert.php
@@ -1,8 +1,8 @@
 <?php
 
-namespace Drupal\Database\Driver\sqlite;
+namespace Drupal\Core\Database\Driver\sqlite;
 
-use Drupal\Database\Query\Insert as QueryInsert;
+use Drupal\Core\Database\Query\Insert as QueryInsert;
 
 /**
  * SQLite specific implementation of InsertQuery.
diff --git a/core/includes/Drupal/Database/Driver/sqlite/Install/Tasks.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php
similarity index 93%
rename from core/includes/Drupal/Database/Driver/sqlite/Install/Tasks.php
rename to core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php
index 2e670013c76a..1c66477f42d6 100644
--- a/core/includes/Drupal/Database/Driver/sqlite/Install/Tasks.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php
@@ -1,9 +1,9 @@
 <?php
 
 
-namespace Drupal\Database\Driver\sqlite\Install;
+namespace Drupal\Core\Database\Driver\sqlite\Install;
 
-use Drupal\Database\Install\Tasks as InstallTasks;
+use Drupal\Core\Database\Install\Tasks as InstallTasks;
 
 use SplFileInfo;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Merge.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Merge.php
new file mode 100644
index 000000000000..080a2b675a90
--- /dev/null
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Merge.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace Drupal\Core\Database\Driver\sqlite;
+
+use Drupal\Core\Database\Query\Merge as QueryMerge;
+
+class Merge extends QueryMerge { }
diff --git a/core/includes/Drupal/Database/Driver/sqlite/Schema.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php
similarity index 99%
rename from core/includes/Drupal/Database/Driver/sqlite/Schema.php
rename to core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php
index 30369f938293..143c6b89dfc5 100644
--- a/core/includes/Drupal/Database/Driver/sqlite/Schema.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php
@@ -1,10 +1,10 @@
 <?php
 
-namespace Drupal\Database\Driver\sqlite;
+namespace Drupal\Core\Database\Driver\sqlite;
 
-use Drupal\Database\SchemaObjectExistsException;
-use Drupal\Database\SchemaObjectDoesNotExistException;
-use Drupal\Database\Schema as DatabaseSchema;
+use Drupal\Core\Database\SchemaObjectExistsException;
+use Drupal\Core\Database\SchemaObjectDoesNotExistException;
+use Drupal\Core\Database\Schema as DatabaseSchema;
 
 use Exception;
 
diff --git a/core/includes/Drupal/Database/Driver/sqlite/Select.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Select.php
similarity index 62%
rename from core/includes/Drupal/Database/Driver/sqlite/Select.php
rename to core/lib/Drupal/Core/Database/Driver/sqlite/Select.php
index df140e629b57..7840cdc0436a 100644
--- a/core/includes/Drupal/Database/Driver/sqlite/Select.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Select.php
@@ -1,8 +1,8 @@
 <?php
 
-namespace Drupal\Database\Driver\sqlite;
+namespace Drupal\Core\Database\Driver\sqlite;
 
-use Drupal\Database\Query\Select as QuerySelect;
+use Drupal\Core\Database\Query\Select as QuerySelect;
 
 class Select extends QuerySelect {
   public function forUpdate($set = TRUE) {
diff --git a/core/includes/Drupal/Database/Driver/sqlite/Statement.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Statement.php
similarity index 97%
rename from core/includes/Drupal/Database/Driver/sqlite/Statement.php
rename to core/lib/Drupal/Core/Database/Driver/sqlite/Statement.php
index 262800c9d8a9..c4fbd5e7ce81 100644
--- a/core/includes/Drupal/Database/Driver/sqlite/Statement.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Statement.php
@@ -1,9 +1,9 @@
 <?php
 
-namespace Drupal\Database\Driver\sqlite;
+namespace Drupal\Core\Database\Driver\sqlite;
 
-use Drupal\Database\StatementPrefetch;
-use Drupal\Database\StatementInterface;
+use Drupal\Core\Database\StatementPrefetch;
+use Drupal\Core\Database\StatementInterface;
 
 use Iterator;
 use PDOException;
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Transaction.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Transaction.php
new file mode 100644
index 000000000000..fb8e1e1dd38b
--- /dev/null
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Transaction.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace Drupal\Core\Database\Driver\sqlite;
+
+use Drupal\Core\Database\Transaction as DatabaseTransaction;
+
+class Transaction extends DatabaseTransaction { }
diff --git a/core/includes/Drupal/Database/Driver/sqlite/Truncate.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Truncate.php
similarity index 83%
rename from core/includes/Drupal/Database/Driver/sqlite/Truncate.php
rename to core/lib/Drupal/Core/Database/Driver/sqlite/Truncate.php
index 49825e7216be..5d8603d16f5f 100644
--- a/core/includes/Drupal/Database/Driver/sqlite/Truncate.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Truncate.php
@@ -1,8 +1,8 @@
 <?php
 
-namespace Drupal\Database\Driver\sqlite;
+namespace Drupal\Core\Database\Driver\sqlite;
 
-use Drupal\Database\Query\Truncate as QueryTruncate;
+use Drupal\Core\Database\Query\Truncate as QueryTruncate;
 
 /**
  * SQLite specific implementation of TruncateQuery.
diff --git a/core/includes/Drupal/Database/Driver/sqlite/Update.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Update.php
similarity index 91%
rename from core/includes/Drupal/Database/Driver/sqlite/Update.php
rename to core/lib/Drupal/Core/Database/Driver/sqlite/Update.php
index 47a07799a602..e010041c20b2 100644
--- a/core/includes/Drupal/Database/Driver/sqlite/Update.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Update.php
@@ -1,10 +1,10 @@
 <?php
 
-namespace Drupal\Database\Driver\sqlite;
+namespace Drupal\Core\Database\Driver\sqlite;
 
-use Drupal\Database\Query\Condition;
-use Drupal\Database\Query\ConditionInterface;
-use Drupal\Database\Query\Update as QueryUpdate;
+use Drupal\Core\Database\Query\Condition;
+use Drupal\Core\Database\Query\ConditionInterface;
+use Drupal\Core\Database\Query\Update as QueryUpdate;
 
 /**
  * SQLite specific implementation of UpdateQuery.
diff --git a/core/includes/Drupal/Database/DriverNotSpecifiedException.php b/core/lib/Drupal/Core/Database/DriverNotSpecifiedException.php
similarity index 84%
rename from core/includes/Drupal/Database/DriverNotSpecifiedException.php
rename to core/lib/Drupal/Core/Database/DriverNotSpecifiedException.php
index 5300394ff772..aa3ae4a509d7 100644
--- a/core/includes/Drupal/Database/DriverNotSpecifiedException.php
+++ b/core/lib/Drupal/Core/Database/DriverNotSpecifiedException.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
 use RuntimeException;
 
diff --git a/core/includes/Drupal/Database/Install/TaskException.php b/core/lib/Drupal/Core/Database/Install/TaskException.php
similarity index 77%
rename from core/includes/Drupal/Database/Install/TaskException.php
rename to core/lib/Drupal/Core/Database/Install/TaskException.php
index 648a96f68c9a..f5eb40ef602d 100644
--- a/core/includes/Drupal/Database/Install/TaskException.php
+++ b/core/lib/Drupal/Core/Database/Install/TaskException.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database\Install;
+namespace Drupal\Core\Database\Install;
 
 use RuntimeException;
 
diff --git a/core/includes/Drupal/Database/Install/Tasks.php b/core/lib/Drupal/Core/Database/Install/Tasks.php
similarity index 99%
rename from core/includes/Drupal/Database/Install/Tasks.php
rename to core/lib/Drupal/Core/Database/Install/Tasks.php
index 4acdb32ada94..4f0bb77bc289 100644
--- a/core/includes/Drupal/Database/Install/Tasks.php
+++ b/core/lib/Drupal/Core/Database/Install/Tasks.php
@@ -1,8 +1,8 @@
 <?php
 
-namespace Drupal\Database\Install;
+namespace Drupal\Core\Database\Install;
 
-use Drupal\Database\Database;
+use Drupal\Core\Database\Database;
 
 use PDO;
 
diff --git a/core/includes/Drupal/Database/Log.php b/core/lib/Drupal/Core/Database/Log.php
similarity index 99%
rename from core/includes/Drupal/Database/Log.php
rename to core/lib/Drupal/Core/Database/Log.php
index 5d09ae3ba125..dfb90477fc86 100644
--- a/core/includes/Drupal/Database/Log.php
+++ b/core/lib/Drupal/Core/Database/Log.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
 /**
  * Database query logger.
diff --git a/core/includes/Drupal/Database/Query/AlterableInterface.php b/core/lib/Drupal/Core/Database/Query/AlterableInterface.php
similarity index 98%
rename from core/includes/Drupal/Database/Query/AlterableInterface.php
rename to core/lib/Drupal/Core/Database/Query/AlterableInterface.php
index ef0f78b63e09..a7a469bed0c7 100644
--- a/core/includes/Drupal/Database/Query/AlterableInterface.php
+++ b/core/lib/Drupal/Core/Database/Query/AlterableInterface.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database\Query;
+namespace Drupal\Core\Database\Query;
 
 /**
  * Interface for a query that can be manipulated via an alter hook.
diff --git a/core/includes/Drupal/Database/Query/Condition.php b/core/lib/Drupal/Core/Database/Query/Condition.php
similarity index 99%
rename from core/includes/Drupal/Database/Query/Condition.php
rename to core/lib/Drupal/Core/Database/Query/Condition.php
index b636d76408ee..b0006fab316c 100644
--- a/core/includes/Drupal/Database/Query/Condition.php
+++ b/core/lib/Drupal/Core/Database/Query/Condition.php
@@ -1,8 +1,8 @@
 <?php
 
-namespace Drupal\Database\Query;
+namespace Drupal\Core\Database\Query;
 
-use Drupal\Database\Connection;
+use Drupal\Core\Database\Connection;
 
 use Countable;
 
diff --git a/core/includes/Drupal/Database/Query/ConditionInterface.php b/core/lib/Drupal/Core/Database/Query/ConditionInterface.php
similarity index 98%
rename from core/includes/Drupal/Database/Query/ConditionInterface.php
rename to core/lib/Drupal/Core/Database/Query/ConditionInterface.php
index 6a30abf81522..8a2d46e26689 100644
--- a/core/includes/Drupal/Database/Query/ConditionInterface.php
+++ b/core/lib/Drupal/Core/Database/Query/ConditionInterface.php
@@ -1,8 +1,8 @@
 <?php
 
-namespace Drupal\Database\Query;
+namespace Drupal\Core\Database\Query;
 
-use Drupal\Database\Connection;
+use Drupal\Core\Database\Connection;
 
 /**
  * Interface for a conditional clause in a query.
diff --git a/core/includes/Drupal/Database/Query/Delete.php b/core/lib/Drupal/Core/Database/Query/Delete.php
similarity index 97%
rename from core/includes/Drupal/Database/Query/Delete.php
rename to core/lib/Drupal/Core/Database/Query/Delete.php
index 81a8b942e4c9..77a74d85f654 100644
--- a/core/includes/Drupal/Database/Query/Delete.php
+++ b/core/lib/Drupal/Core/Database/Query/Delete.php
@@ -1,9 +1,9 @@
 <?php
 
-namespace Drupal\Database\Query;
+namespace Drupal\Core\Database\Query;
 
-use Drupal\Database\Database;
-use Drupal\Database\Connection;
+use Drupal\Core\Database\Database;
+use Drupal\Core\Database\Connection;
 
 /**
  * General class for an abstracted DELETE operation.
diff --git a/core/includes/Drupal/Database/Query/ExtendableInterface.php b/core/lib/Drupal/Core/Database/Query/ExtendableInterface.php
similarity index 96%
rename from core/includes/Drupal/Database/Query/ExtendableInterface.php
rename to core/lib/Drupal/Core/Database/Query/ExtendableInterface.php
index edc24d9265c7..63926ecb8c77 100644
--- a/core/includes/Drupal/Database/Query/ExtendableInterface.php
+++ b/core/lib/Drupal/Core/Database/Query/ExtendableInterface.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database\Query;
+namespace Drupal\Core\Database\Query;
 
 /**
  * Interface for extendable query objects.
diff --git a/core/includes/Drupal/Database/Query/FieldsOverlapException.php b/core/lib/Drupal/Core/Database/Query/FieldsOverlapException.php
similarity index 88%
rename from core/includes/Drupal/Database/Query/FieldsOverlapException.php
rename to core/lib/Drupal/Core/Database/Query/FieldsOverlapException.php
index a92fd94d3d07..92acc2505bde 100644
--- a/core/includes/Drupal/Database/Query/FieldsOverlapException.php
+++ b/core/lib/Drupal/Core/Database/Query/FieldsOverlapException.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database\Query;
+namespace Drupal\Core\Database\Query;
 
 use RuntimeException;
 
diff --git a/core/includes/Drupal/Database/Query/Insert.php b/core/lib/Drupal/Core/Database/Query/Insert.php
similarity index 99%
rename from core/includes/Drupal/Database/Query/Insert.php
rename to core/lib/Drupal/Core/Database/Query/Insert.php
index 76c924c903f2..775f857cd150 100644
--- a/core/includes/Drupal/Database/Query/Insert.php
+++ b/core/lib/Drupal/Core/Database/Query/Insert.php
@@ -1,8 +1,8 @@
 <?php
 
-namespace Drupal\Database\Query;
+namespace Drupal\Core\Database\Query;
 
-use Drupal\Database\Database;
+use Drupal\Core\Database\Database;
 
 /**
  * General class for an abstracted INSERT query.
diff --git a/core/includes/Drupal/Database/Query/InvalidMergeQueryException.php b/core/lib/Drupal/Core/Database/Query/InvalidMergeQueryException.php
similarity index 89%
rename from core/includes/Drupal/Database/Query/InvalidMergeQueryException.php
rename to core/lib/Drupal/Core/Database/Query/InvalidMergeQueryException.php
index 9a840d16c59d..c7f4ea0b0595 100644
--- a/core/includes/Drupal/Database/Query/InvalidMergeQueryException.php
+++ b/core/lib/Drupal/Core/Database/Query/InvalidMergeQueryException.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database\Query;
+namespace Drupal\Core\Database\Query;
 
 use RuntimeException;
 
diff --git a/core/includes/Drupal/Database/Query/Merge.php b/core/lib/Drupal/Core/Database/Query/Merge.php
similarity index 99%
rename from core/includes/Drupal/Database/Query/Merge.php
rename to core/lib/Drupal/Core/Database/Query/Merge.php
index f08f5d3ea42c..f327923c0452 100644
--- a/core/includes/Drupal/Database/Query/Merge.php
+++ b/core/lib/Drupal/Core/Database/Query/Merge.php
@@ -1,9 +1,9 @@
 <?php
 
-namespace Drupal\Database\Query;
+namespace Drupal\Core\Database\Query;
 
-use Drupal\Database\Database;
-use Drupal\Database\Connection;
+use Drupal\Core\Database\Database;
+use Drupal\Core\Database\Connection;
 
 use Exception;
 
diff --git a/core/includes/Drupal/Database/Query/NoFieldsException.php b/core/lib/Drupal/Core/Database/Query/NoFieldsException.php
similarity index 80%
rename from core/includes/Drupal/Database/Query/NoFieldsException.php
rename to core/lib/Drupal/Core/Database/Query/NoFieldsException.php
index 0b1728239c44..1ec652fbd9fa 100644
--- a/core/includes/Drupal/Database/Query/NoFieldsException.php
+++ b/core/lib/Drupal/Core/Database/Query/NoFieldsException.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database\Query;
+namespace Drupal\Core\Database\Query;
 
 use Exception;
 
diff --git a/core/includes/Drupal/Database/Query/PlaceholderInterface.php b/core/lib/Drupal/Core/Database/Query/PlaceholderInterface.php
similarity index 90%
rename from core/includes/Drupal/Database/Query/PlaceholderInterface.php
rename to core/lib/Drupal/Core/Database/Query/PlaceholderInterface.php
index 509a30d29af2..ddfb5ffea754 100644
--- a/core/includes/Drupal/Database/Query/PlaceholderInterface.php
+++ b/core/lib/Drupal/Core/Database/Query/PlaceholderInterface.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database\Query;
+namespace Drupal\Core\Database\Query;
 
 /**
  * Interface for a query that accepts placeholders.
diff --git a/core/includes/Drupal/Database/Query/Query.php b/core/lib/Drupal/Core/Database/Query/Query.php
similarity index 97%
rename from core/includes/Drupal/Database/Query/Query.php
rename to core/lib/Drupal/Core/Database/Query/Query.php
index 21cfb8ebea98..30e5a86b9698 100644
--- a/core/includes/Drupal/Database/Query/Query.php
+++ b/core/lib/Drupal/Core/Database/Query/Query.php
@@ -1,9 +1,9 @@
 <?php
 
-namespace Drupal\Database\Query;
+namespace Drupal\Core\Database\Query;
 
-use Drupal\Database\Database;
-use Drupal\Database\Connection;
+use Drupal\Core\Database\Database;
+use Drupal\Core\Database\Connection;
 
 /**
  * Base class for query builders.
diff --git a/core/includes/Drupal/Database/Query/Select.php b/core/lib/Drupal/Core/Database/Query/Select.php
similarity index 99%
rename from core/includes/Drupal/Database/Query/Select.php
rename to core/lib/Drupal/Core/Database/Query/Select.php
index 97e01b64e7a8..a6970c35a518 100644
--- a/core/includes/Drupal/Database/Query/Select.php
+++ b/core/lib/Drupal/Core/Database/Query/Select.php
@@ -1,9 +1,9 @@
 <?php
 
-namespace Drupal\Database\Query;
+namespace Drupal\Core\Database\Query;
 
-use Drupal\Database\Database;
-use Drupal\Database\Connection;
+use Drupal\Core\Database\Database;
+use Drupal\Core\Database\Connection;
 
 
 /**
diff --git a/core/includes/Drupal/Database/Query/SelectExtender.php b/core/lib/Drupal/Core/Database/Query/SelectExtender.php
similarity index 99%
rename from core/includes/Drupal/Database/Query/SelectExtender.php
rename to core/lib/Drupal/Core/Database/Query/SelectExtender.php
index 27a30e0dfb10..c35980a2b03c 100644
--- a/core/includes/Drupal/Database/Query/SelectExtender.php
+++ b/core/lib/Drupal/Core/Database/Query/SelectExtender.php
@@ -1,8 +1,8 @@
 <?php
 
-namespace Drupal\Database\Query;
+namespace Drupal\Core\Database\Query;
 
-use Drupal\Database\Connection;
+use Drupal\Core\Database\Connection;
 
 /**
  * The base extender class for Select queries.
diff --git a/core/includes/Drupal/Database/Query/SelectInterface.php b/core/lib/Drupal/Core/Database/Query/SelectInterface.php
similarity index 99%
rename from core/includes/Drupal/Database/Query/SelectInterface.php
rename to core/lib/Drupal/Core/Database/Query/SelectInterface.php
index b023778cac18..ce8efa78f24b 100644
--- a/core/includes/Drupal/Database/Query/SelectInterface.php
+++ b/core/lib/Drupal/Core/Database/Query/SelectInterface.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database\Query;
+namespace Drupal\Core\Database\Query;
 
 /**
  * Interface definition for a Select Query object.
diff --git a/core/includes/Drupal/Database/Query/Truncate.php b/core/lib/Drupal/Core/Database/Query/Truncate.php
similarity index 93%
rename from core/includes/Drupal/Database/Query/Truncate.php
rename to core/lib/Drupal/Core/Database/Query/Truncate.php
index 6877e4d60dbc..194c9a9aa7c2 100644
--- a/core/includes/Drupal/Database/Query/Truncate.php
+++ b/core/lib/Drupal/Core/Database/Query/Truncate.php
@@ -1,9 +1,9 @@
 <?php
 
-namespace Drupal\Database\Query;
+namespace Drupal\Core\Database\Query;
 
-use Drupal\Database\Database;
-use Drupal\Database\Connection;
+use Drupal\Core\Database\Database;
+use Drupal\Core\Database\Connection;
 
 
 /**
diff --git a/core/includes/Drupal/Database/Query/Update.php b/core/lib/Drupal/Core/Database/Query/Update.php
similarity index 98%
rename from core/includes/Drupal/Database/Query/Update.php
rename to core/lib/Drupal/Core/Database/Query/Update.php
index 2a8315af4ef7..cdd053a58d85 100644
--- a/core/includes/Drupal/Database/Query/Update.php
+++ b/core/lib/Drupal/Core/Database/Query/Update.php
@@ -1,9 +1,9 @@
 <?php
 
-namespace Drupal\Database\Query;
+namespace Drupal\Core\Database\Query;
 
-use Drupal\Database\Database;
-use Drupal\Database\Connection;
+use Drupal\Core\Database\Database;
+use Drupal\Core\Database\Connection;
 
 /**
  * General class for an abstracted UPDATE operation.
diff --git a/core/includes/Drupal/Database/Schema.php b/core/lib/Drupal/Core/Database/Schema.php
similarity index 99%
rename from core/includes/Drupal/Database/Schema.php
rename to core/lib/Drupal/Core/Database/Schema.php
index acbc0461c9ab..b8c7e15334d4 100644
--- a/core/includes/Drupal/Database/Schema.php
+++ b/core/lib/Drupal/Core/Database/Schema.php
@@ -1,10 +1,10 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
-use Drupal\Database\SchemaObjectExistsException;
-use Drupal\Database\Query\Condition;
-use Drupal\Database\Query\PlaceholderInterface;
+use Drupal\Core\Database\SchemaObjectExistsException;
+use Drupal\Core\Database\Query\Condition;
+use Drupal\Core\Database\Query\PlaceholderInterface;
 
 /**
  * @defgroup schemaapi Schema API
diff --git a/core/includes/Drupal/Database/SchemaException.php b/core/lib/Drupal/Core/Database/SchemaException.php
similarity index 80%
rename from core/includes/Drupal/Database/SchemaException.php
rename to core/lib/Drupal/Core/Database/SchemaException.php
index 2d321d2bdaa7..b36386beb1d2 100644
--- a/core/includes/Drupal/Database/SchemaException.php
+++ b/core/lib/Drupal/Core/Database/SchemaException.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
 use RuntimeException;
 
diff --git a/core/includes/Drupal/Database/SchemaObjectDoesNotExistException.php b/core/lib/Drupal/Core/Database/SchemaObjectDoesNotExistException.php
similarity index 91%
rename from core/includes/Drupal/Database/SchemaObjectDoesNotExistException.php
rename to core/lib/Drupal/Core/Database/SchemaObjectDoesNotExistException.php
index ebf1eebe379e..c6a82a7b4866 100644
--- a/core/includes/Drupal/Database/SchemaObjectDoesNotExistException.php
+++ b/core/lib/Drupal/Core/Database/SchemaObjectDoesNotExistException.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
 /**
  * Exception thrown if an object being modified doesn't exist yet.
diff --git a/core/includes/Drupal/Database/SchemaObjectExistsException.php b/core/lib/Drupal/Core/Database/SchemaObjectExistsException.php
similarity index 90%
rename from core/includes/Drupal/Database/SchemaObjectExistsException.php
rename to core/lib/Drupal/Core/Database/SchemaObjectExistsException.php
index b6e0299e07c5..af081d016676 100644
--- a/core/includes/Drupal/Database/SchemaObjectExistsException.php
+++ b/core/lib/Drupal/Core/Database/SchemaObjectExistsException.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
 /**
  * Exception thrown if an object being created already exists.
diff --git a/core/includes/Drupal/Database/StatementBase.php b/core/lib/Drupal/Core/Database/StatementBase.php
similarity index 98%
rename from core/includes/Drupal/Database/StatementBase.php
rename to core/lib/Drupal/Core/Database/StatementBase.php
index e649044c7a75..72bdaccc26ae 100644
--- a/core/includes/Drupal/Database/StatementBase.php
+++ b/core/lib/Drupal/Core/Database/StatementBase.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
 use PDO;
 use PDOStatement;
diff --git a/core/includes/Drupal/Database/StatementEmpty.php b/core/lib/Drupal/Core/Database/StatementEmpty.php
similarity index 98%
rename from core/includes/Drupal/Database/StatementEmpty.php
rename to core/lib/Drupal/Core/Database/StatementEmpty.php
index 7ccba69d92f7..179f22b715ba 100644
--- a/core/includes/Drupal/Database/StatementEmpty.php
+++ b/core/lib/Drupal/Core/Database/StatementEmpty.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
 use Iterator;
 
diff --git a/core/includes/Drupal/Database/StatementInterface.php b/core/lib/Drupal/Core/Database/StatementInterface.php
similarity index 99%
rename from core/includes/Drupal/Database/StatementInterface.php
rename to core/lib/Drupal/Core/Database/StatementInterface.php
index c169bf98fc69..3187a247d70f 100644
--- a/core/includes/Drupal/Database/StatementInterface.php
+++ b/core/lib/Drupal/Core/Database/StatementInterface.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
 use Traversable;
 
diff --git a/core/includes/Drupal/Database/StatementPrefetch.php b/core/lib/Drupal/Core/Database/StatementPrefetch.php
similarity index 99%
rename from core/includes/Drupal/Database/StatementPrefetch.php
rename to core/lib/Drupal/Core/Database/StatementPrefetch.php
index 2d73cf44403b..965de3db93c5 100644
--- a/core/includes/Drupal/Database/StatementPrefetch.php
+++ b/core/lib/Drupal/Core/Database/StatementPrefetch.php
@@ -1,8 +1,8 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
-use Drupal\Database\Connection;
+use Drupal\Core\Database\Connection;
 use Iterator;
 use PDO;
 use PDOException;
diff --git a/core/includes/Drupal/Database/Transaction.php b/core/lib/Drupal/Core/Database/Transaction.php
similarity index 98%
rename from core/includes/Drupal/Database/Transaction.php
rename to core/lib/Drupal/Core/Database/Transaction.php
index e2b34f588258..4f78928deb89 100644
--- a/core/includes/Drupal/Database/Transaction.php
+++ b/core/lib/Drupal/Core/Database/Transaction.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
 /**
  * A wrapper class for creating and managing database transactions.
diff --git a/core/includes/Drupal/Database/TransactionCommitFailedException.php b/core/lib/Drupal/Core/Database/TransactionCommitFailedException.php
similarity index 81%
rename from core/includes/Drupal/Database/TransactionCommitFailedException.php
rename to core/lib/Drupal/Core/Database/TransactionCommitFailedException.php
index c6348c13c4f6..1ddeea4d30d1 100644
--- a/core/includes/Drupal/Database/TransactionCommitFailedException.php
+++ b/core/lib/Drupal/Core/Database/TransactionCommitFailedException.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
 /**
  * Exception thrown when a commit() function fails.
diff --git a/core/includes/Drupal/Database/TransactionException.php b/core/lib/Drupal/Core/Database/TransactionException.php
similarity index 82%
rename from core/includes/Drupal/Database/TransactionException.php
rename to core/lib/Drupal/Core/Database/TransactionException.php
index f0f748ba46e0..3ce78dc5a96a 100644
--- a/core/includes/Drupal/Database/TransactionException.php
+++ b/core/lib/Drupal/Core/Database/TransactionException.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
 use RuntimeException;
 
diff --git a/core/includes/Drupal/Database/TransactionExplicitCommitNotAllowedException.php b/core/lib/Drupal/Core/Database/TransactionExplicitCommitNotAllowedException.php
similarity index 90%
rename from core/includes/Drupal/Database/TransactionExplicitCommitNotAllowedException.php
rename to core/lib/Drupal/Core/Database/TransactionExplicitCommitNotAllowedException.php
index f39f09989d17..149cf7479369 100644
--- a/core/includes/Drupal/Database/TransactionExplicitCommitNotAllowedException.php
+++ b/core/lib/Drupal/Core/Database/TransactionExplicitCommitNotAllowedException.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
 /**
  * Exception to deny attempts to explicitly manage transactions.
diff --git a/core/includes/Drupal/Database/TransactionNameNonUniqueException.php b/core/lib/Drupal/Core/Database/TransactionNameNonUniqueException.php
similarity index 83%
rename from core/includes/Drupal/Database/TransactionNameNonUniqueException.php
rename to core/lib/Drupal/Core/Database/TransactionNameNonUniqueException.php
index 2c02577a309b..d92feda98901 100644
--- a/core/includes/Drupal/Database/TransactionNameNonUniqueException.php
+++ b/core/lib/Drupal/Core/Database/TransactionNameNonUniqueException.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
 /**
  * Exception thrown when a savepoint or transaction name occurs twice.
diff --git a/core/includes/Drupal/Database/TransactionNoActiveException.php b/core/lib/Drupal/Core/Database/TransactionNoActiveException.php
similarity index 83%
rename from core/includes/Drupal/Database/TransactionNoActiveException.php
rename to core/lib/Drupal/Core/Database/TransactionNoActiveException.php
index 0bc07984bf5c..e9d136b676a1 100644
--- a/core/includes/Drupal/Database/TransactionNoActiveException.php
+++ b/core/lib/Drupal/Core/Database/TransactionNoActiveException.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
 /**
  * Exception for when popTransaction() is called with no active transaction.
diff --git a/core/includes/Drupal/Database/TransactionOutOfOrderException.php b/core/lib/Drupal/Core/Database/TransactionOutOfOrderException.php
similarity index 84%
rename from core/includes/Drupal/Database/TransactionOutOfOrderException.php
rename to core/lib/Drupal/Core/Database/TransactionOutOfOrderException.php
index 8f9f2fe93728..058070f5a6e2 100644
--- a/core/includes/Drupal/Database/TransactionOutOfOrderException.php
+++ b/core/lib/Drupal/Core/Database/TransactionOutOfOrderException.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Database;
+namespace Drupal\Core\Database;
 
 /**
  * Exception thrown when a rollback() resulted in other active transactions being rolled-back.
diff --git a/core/modules/dblog/dblog.module b/core/modules/dblog/dblog.module
index b1d545b6e6d7..56830b6d07b5 100644
--- a/core/modules/dblog/dblog.module
+++ b/core/modules/dblog/dblog.module
@@ -1,6 +1,6 @@
 <?php
 
-use Drupal\Database\Database;
+use Drupal\Core\Database\Database;
 
 /**
  * @file
diff --git a/core/modules/entity/entity.query.inc b/core/modules/entity/entity.query.inc
index 7315fa375826..db59f6db678b 100644
--- a/core/modules/entity/entity.query.inc
+++ b/core/modules/entity/entity.query.inc
@@ -1,6 +1,6 @@
 <?php
 
-use Drupal\Database\Query\Select;
+use Drupal\Core\Database\Query\Select;
 
 /**
  * @file
diff --git a/core/modules/field/modules/field_sql_storage/field_sql_storage.module b/core/modules/field/modules/field_sql_storage/field_sql_storage.module
index 9b17c18f0481..44a923ec4877 100644
--- a/core/modules/field/modules/field_sql_storage/field_sql_storage.module
+++ b/core/modules/field/modules/field_sql_storage/field_sql_storage.module
@@ -1,7 +1,7 @@
 <?php
 
-use Drupal\Database\Database;
-use Drupal\Database\Query\Select;
+use Drupal\Core\Database\Database;
+use Drupal\Core\Database\Query\Select;
 
 /**
  * @file
diff --git a/core/modules/field/modules/field_sql_storage/field_sql_storage.test b/core/modules/field/modules/field_sql_storage/field_sql_storage.test
index 1ceac670c12f..d0cc8f74c07e 100644
--- a/core/modules/field/modules/field_sql_storage/field_sql_storage.test
+++ b/core/modules/field/modules/field_sql_storage/field_sql_storage.test
@@ -1,6 +1,6 @@
 <?php
 
-use Drupal\Database\Database;
+use Drupal\Core\Database\Database;
 
 /**
  * @file
diff --git a/core/modules/node/node.admin.inc b/core/modules/node/node.admin.inc
index 55fd8d50e47b..d8caa94f610d 100644
--- a/core/modules/node/node.admin.inc
+++ b/core/modules/node/node.admin.inc
@@ -1,6 +1,6 @@
 <?php
 
-use Drupal\Database\Query\SelectInterface;
+use Drupal\Core\Database\Query\SelectInterface;
 
 /**
  * @file
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 6fb322c2caf5..630bd3c91964 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -1,8 +1,8 @@
 <?php
 
-use Drupal\Database\Query\AlterableInterface;
-use Drupal\Database\Query\SelectExtender;
-use Drupal\Database\Query\SelectInterface;
+use Drupal\Core\Database\Query\AlterableInterface;
+use Drupal\Core\Database\Query\SelectExtender;
+use Drupal\Core\Database\Query\SelectInterface;
 
 /**
  * @file
diff --git a/core/modules/node/node.test b/core/modules/node/node.test
index 7f70bde70092..afbc5680efcb 100644
--- a/core/modules/node/node.test
+++ b/core/modules/node/node.test
@@ -1,6 +1,6 @@
 <?php
 
-use Drupal\Database\Database;
+use Drupal\Core\Database\Database;
 
 /**
  * @file
diff --git a/core/modules/search/search.extender.inc b/core/modules/search/search.extender.inc
index 588fdca7c358..73f783652f6d 100644
--- a/core/modules/search/search.extender.inc
+++ b/core/modules/search/search.extender.inc
@@ -1,7 +1,7 @@
 <?php
 
-use Drupal\Database\Query\SelectExtender;
-use Drupal\Database\StatementEmpty;
+use Drupal\Core\Database\Query\SelectExtender;
+use Drupal\Core\Database\StatementEmpty;
 
 /**
  * @file
diff --git a/core/modules/simpletest/drupal_web_test_case.php b/core/modules/simpletest/drupal_web_test_case.php
index ff99f346ad48..f86365183604 100644
--- a/core/modules/simpletest/drupal_web_test_case.php
+++ b/core/modules/simpletest/drupal_web_test_case.php
@@ -1,7 +1,7 @@
 <?php
 
-use Drupal\Database\Database;
-use Drupal\Database\ConnectionNotDefinedException;
+use Drupal\Core\Database\Database;
+use Drupal\Core\Database\ConnectionNotDefinedException;
 
 /**
  * Global variable that holds information about the tests being run.
diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index 9221b0bf33ee..080b621b3b7b 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -1,6 +1,6 @@
 <?php
 
-use Drupal\Database\Database;
+use Drupal\Core\Database\Database;
 
 /**
  * @file
diff --git a/core/modules/simpletest/tests/database_test.module b/core/modules/simpletest/tests/database_test.module
index 141112cc5fd7..0ab51d80747a 100644
--- a/core/modules/simpletest/tests/database_test.module
+++ b/core/modules/simpletest/tests/database_test.module
@@ -1,6 +1,6 @@
 <?php
 
-use Drupal\Database\Query\AlterableInterface;
+use Drupal\Core\Database\Query\AlterableInterface;
 
 /**
  * Implements hook_query_alter().
diff --git a/core/modules/simpletest/tests/database_test.test b/core/modules/simpletest/tests/database_test.test
index 7e39e75f3be1..1d38ebb3766b 100644
--- a/core/modules/simpletest/tests/database_test.test
+++ b/core/modules/simpletest/tests/database_test.test
@@ -1,13 +1,13 @@
 <?php
 
-use Drupal\Database\Database;
-use Drupal\Database\StatementEmpty;
-use Drupal\Database\StatementInterface;
-use Drupal\Database\TransactionOutOfOrderException;
-use Drupal\Database\TransactionNoActiveException;
-use Drupal\Database\Query\Merge;
-use Drupal\Database\Query\InvalidMergeQueryException;
-use Drupal\Database\Query\NoFieldsException;
+use Drupal\Core\Database\Database;
+use Drupal\Core\Database\StatementEmpty;
+use Drupal\Core\Database\StatementInterface;
+use Drupal\Core\Database\TransactionOutOfOrderException;
+use Drupal\Core\Database\TransactionNoActiveException;
+use Drupal\Core\Database\Query\Merge;
+use Drupal\Core\Database\Query\InvalidMergeQueryException;
+use Drupal\Core\Database\Query\NoFieldsException;
 
 /**
  * Dummy class for fetching into a class.
diff --git a/core/modules/simpletest/tests/schema.test b/core/modules/simpletest/tests/schema.test
index ca3d70e5c93c..5a105678fc7c 100644
--- a/core/modules/simpletest/tests/schema.test
+++ b/core/modules/simpletest/tests/schema.test
@@ -1,6 +1,6 @@
 <?php
 
-use Drupal\Database\Database;
+use Drupal\Core\Database\Database;
 
 /**
  * @file
diff --git a/core/modules/simpletest/tests/upgrade/upgrade.test b/core/modules/simpletest/tests/upgrade/upgrade.test
index 257043e055b4..53e671bd1cf5 100644
--- a/core/modules/simpletest/tests/upgrade/upgrade.test
+++ b/core/modules/simpletest/tests/upgrade/upgrade.test
@@ -1,6 +1,6 @@
 <?php
 
-use Drupal\Database\Database;
+use Drupal\Core\Database\Database;
 
 /**
  * Perform end-to-end tests of the upgrade path.
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index c26192bb4c9d..ef5a2a332657 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -1,6 +1,6 @@
 <?php
 
-use Drupal\Database\Database;
+use Drupal\Core\Database\Database;
 
 /**
  * @file
diff --git a/core/modules/system/system.test b/core/modules/system/system.test
index 595391b8a903..6d8845872724 100644
--- a/core/modules/system/system.test
+++ b/core/modules/system/system.test
@@ -1,6 +1,6 @@
 <?php
 
-use Drupal\Database\Database;
+use Drupal\Core\Database\Database;
 
 /**
  * @file
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 7ff74b6d08fa..57ef42159677 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -1,6 +1,6 @@
 <?php
 
-use Drupal\Database\Query\SelectInterface;
+use Drupal\Core\Database\Query\SelectInterface;
 
 /**
  * @file
-- 
GitLab