mirror of
https://github.com/dg/dibi.git
synced 2025-08-06 06:07:39 +02:00
SqlsrvReflector::getTables(): gets list of all tables from dbo schema only
This commit is contained in:
@@ -34,7 +34,7 @@ class SqlsrvReflector implements Dibi\Reflector
|
||||
*/
|
||||
public function getTables()
|
||||
{
|
||||
$res = $this->driver->query('SELECT TABLE_NAME, TABLE_TYPE FROM INFORMATION_SCHEMA.TABLES');
|
||||
$res = $this->driver->query("SELECT TABLE_NAME, TABLE_TYPE FROM INFORMATION_SCHEMA.TABLES WHERE [TABLE_SCHEMA] = 'dbo'");
|
||||
$tables = [];
|
||||
while ($row = $res->fetch(FALSE)) {
|
||||
$tables[] = [
|
||||
|
@@ -17,11 +17,12 @@ try {
|
||||
Tester\Environment::skip($e->getMessage());
|
||||
}
|
||||
|
||||
if ($config['system'] !== 'sqlsrv') {
|
||||
Assert::same(3, count($meta->getTables()));
|
||||
|
||||
$names = $meta->getTableNames();
|
||||
sort($names);
|
||||
Assert::equal(['customers', 'orders', 'products'], $names);
|
||||
}
|
||||
|
||||
Assert::false($meta->hasTable('xxxx'));
|
||||
|
||||
|
Reference in New Issue
Block a user