InfluxDB\Database::exists PHP Method

exists() public method

public exists ( ) : boolean
return boolean
    public function exists()
    {
        $databases = $this->client->listDatabases();
        return in_array($this->name, $databases);
    }

Usage Example

Example #1
0
 public function testNotExists()
 {
     $database = new Database('test_not_exists', $this->mockClient);
     $this->assertEquals($database->exists(), false);
 }