diff --git a/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php
index e77bb7b..cdfa4de 100644
--- a/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php
+++ b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php
@@ -15,14 +15,11 @@
 /**
  * Sources whose data may be fetched via DBTNG.
  *
- * You can specify a 'target' configuration key to specify the database target
- * to use for a specific migration source. You can specify an additional
- * database target in settings.php. For example:
- * @code
- *   $databases['migrate']['other_database'] = [ ... ];
- * @endcode
- * Given that you can specify 'target: other_database' in the 'source' part of
- * a migration configuration entity.
+ * By default, an existing database connection with key 'migrate' and target
+ * 'default' is used. These may be overridden with explicit 'key' and/or
+ * 'target' configuration keys. In addition, if the configuration key 'database'
+ * is present, it is used as a database connection information array to define
+ * the connection.
  */
 abstract class SqlBase extends SourcePluginBase {
 
@@ -66,11 +63,22 @@ public function __toString() {
    */
   public function getDatabase() {
     if (!isset($this->database)) {
-      $target = 'default';
       if (isset($this->configuration['target'])) {
         $target = $this->configuration['target'];
       }
-      $this->database = Database::getConnection($target, 'migrate');
+      else {
+        $target = 'default';
+      }
+      if (isset($this->configuration['key'])) {
+        $key = $this->configuration['key'];
+      }
+      else {
+        $key = 'migrate';
+      }
+      if (isset($this->configuration['database'])) {
+        Database::addConnectionInfo($key, $target, $this->configuration['database']);
+      }
+      $this->database = Database::getConnection($target, $key);
     }
     return $this->database;
   }
diff --git a/core/modules/migrate/src/Tests/SqlBaseTest.php b/core/modules/migrate/src/Tests/SqlBaseTest.php
index 91423b2..9a96bb4 100644
--- a/core/modules/migrate/src/Tests/SqlBaseTest.php
+++ b/core/modules/migrate/src/Tests/SqlBaseTest.php
@@ -22,14 +22,36 @@ class SqlBaseTest extends MigrateTestBase {
    */
   public function testConnectionTypes() {
     $sql_base = new TestSqlBase();
+
+    // Check the default values.
     $this->assertIdentical($sql_base->getDatabase()->getTarget(), 'default');
+    $this->assertIdentical($sql_base->getDatabase()->getKey(), 'migrate');
 
     $target = 'test_db_target';
-    $config = array('target' => $target);
+    $key = 'test_migrate_connection';
+    $config = array('target' => $target, 'key' => $key);
     $sql_base->setConfiguration($config);
-    Database::addConnectionInfo('migrate', $target, Database::getConnectionInfo('default')['default']);
+    Database::addConnectionInfo($key, $target, Database::getConnectionInfo('default')['default']);
 
+    // Validate we've injected our custom key and target.
     $this->assertIdentical($sql_base->getDatabase()->getTarget(), $target);
+    $this->assertIdentical($sql_base->getDatabase()->getKey(), $key);
+
+    // Now test we can have SqlBase create the connection from an info array.
+    $sql_base = new TestSqlBase();
+
+    $target = 'test_db_target2';
+    $key = 'test_migrate_connection2';
+    $database = Database::getConnectionInfo('default')['default'];
+    $config = array('target' => $target, 'key' => $key, 'database' => $database);
+    $sql_base->setConfiguration($config);
+
+    // Call getDatabase() to get the connection defined.
+    $sql_base->getDatabase();
+
+    // Validate the connection has been created with the right values.
+    $this->assertIdentical(Database::getConnectionInfo($key)[$target], $database);
+
   }
 
 }
