public function create(RetentionPolicy $retentionPolicy = null, $createIfNotExists = true)
{
try {
$query = sprintf('CREATE DATABASE %s"%s"', $createIfNotExists ? 'IF NOT EXISTS ' : '', $this->name);
$this->query($query);
if ($retentionPolicy) {
$this->createRetentionPolicy($retentionPolicy);
}
} catch (Exception $e) {
throw new DatabaseException(sprintf('Failed to created database %s', $this->name), $e->getCode(), $e);
}
}