source/Spiral/Database/Drivers/Postgres/PostgresDriver.php 1 location
|
@@ 97-108 (lines=12) @@
|
| 94 |
|
/** |
| 95 |
|
* {@inheritdoc} |
| 96 |
|
*/ |
| 97 |
|
public function tableNames() |
| 98 |
|
{ |
| 99 |
|
$query = 'SELECT "table_name" FROM "information_schema"."tables" ' |
| 100 |
|
. 'WHERE "table_schema" = \'public\' AND "table_type" = \'BASE TABLE\''; |
| 101 |
|
|
| 102 |
|
$tables = []; |
| 103 |
|
foreach ($this->query($query) as $row) { |
| 104 |
|
$tables[] = $row['table_name']; |
| 105 |
|
} |
| 106 |
|
|
| 107 |
|
return $tables; |
| 108 |
|
} |
| 109 |
|
|
| 110 |
|
/** |
| 111 |
|
* Get singular primary key associated with desired table. Used to emulate last insert id. |
source/Spiral/Database/Drivers/SQLServer/SQLServerDriver.php 1 location
|
@@ 104-114 (lines=11) @@
|
| 101 |
|
/** |
| 102 |
|
* {@inheritdoc} |
| 103 |
|
*/ |
| 104 |
|
public function tableNames() |
| 105 |
|
{ |
| 106 |
|
$query = "SELECT table_name FROM information_schema.tables WHERE table_type = 'BASE TABLE'"; |
| 107 |
|
|
| 108 |
|
$tables = []; |
| 109 |
|
foreach ($this->query($query)->fetchMode(PDO::FETCH_NUM) as $row) { |
| 110 |
|
$tables[] = $row[0]; |
| 111 |
|
} |
| 112 |
|
|
| 113 |
|
return $tables; |
| 114 |
|
} |
| 115 |
|
|
| 116 |
|
/** |
| 117 |
|
* SQLServer version. |