class PgSqlHandler in DB Maintenance 8
Same name and namespace in other branches
- 7.2 src/Module/Db/DbServer/PgSql/PgSqlHandler.php \Drupal\db_maintenance\Module\Db\DbServer\PgSql\PgSqlHandler
- 2.0.x src/Module/Db/DbServer/PgSql/PgSqlHandler.php \Drupal\db_maintenance\Module\Db\DbServer\PgSql\PgSqlHandler
PgSqlHandler class.
Hierarchy
- class \Drupal\db_maintenance\Module\Db\DbServer\PgSql\PgSqlHandler implements DbServerHandlerInterface
Expanded class hierarchy of PgSqlHandler
1 file declares its use of PgSqlHandler
- DbServerHandlerFactory.php in src/
Module/ Db/ DbServer/ DbServerHandlerFactory.php - DbServerHandlerFactory class.
File
- src/
Module/ Db/ DbServer/ PgSql/ PgSqlHandler.php, line 15 - PgSqlHandler class.
Namespace
Drupal\db_maintenance\Module\Db\DbServer\PgSqlView source
class PgSqlHandler implements DbServerHandlerInterface {
/**
* Returns list of tables in the active database.
*/
public function listTables() {
$result = \Drupal::database()
->query("SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' ORDER BY table_name", array(), array(
'fetch' => \PDO::FETCH_ASSOC,
));
return $result;
}
/**
* Optimizes table in the active database.
*/
public function optimizeTable($table_name) {
try {
\Drupal::database()
->query("VACUUM ANALYZE {$table_name}")
->execute();
} catch (\Exception $e) {
watchdog_exception('type', $e);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PgSqlHandler:: |
public | function |
Returns list of tables in the active database. Overrides DbServerHandlerInterface:: |
|
PgSqlHandler:: |
public | function |
Optimizes table in the active database. Overrides DbServerHandlerInterface:: |