public function dropDatasource($datasource)
{
$sql = "DROP TABLE " . $datasource;
// Add query to log
\Spot\Log::addQuery($this, $sql);
try {
return $this->connection()->exec($sql);
} catch (\PDOException $e) {
// Table does not exist
if ($e->getCode() == "42S02") {
throw new \Spot\Exception_Datasource_Missing("Table or datasource '" . $datasource . "' does not exist");
}
// Re-throw exception
throw $e;
}
}