This commit is contained in:
Bastian Allgeier
2019-01-14 10:52:45 +01:00
parent 01277f79f2
commit 8070893b64
22 changed files with 482 additions and 351 deletions

View File

@@ -337,6 +337,16 @@ class Database
return $this->lastError;
}
/**
* Returns the name of the database
*
* @return string|null
*/
public function name(): ?string
{
return $this->database;
}
/**
* Private method to execute database queries.
* This is used by the query() and execute() methods

View File

@@ -72,7 +72,7 @@ class Sql
return [
'query' => $query,
'bindings' => [
$databaseBinding => $this->database->database,
$databaseBinding => $this->database->name(),
$tableBinding => $table,
]
];
@@ -696,7 +696,7 @@ class Sql
return [
'query' => 'SELECT TABLE_NAME AS name FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ' . $binding,
'bindings' => [
$binding => $this->database->database
$binding => $this->database->name()
]
];
}