Ruckusing_Adapter_PgSQL_Base::drop_database PHP Method

drop_database() public method

Drop a database
public drop_database ( string $db ) : boolean
$db string the db name
return boolean
    public function drop_database($db)
    {
        if (!$this->database_exists($db)) {
            return false;
        }
        $ddl = sprintf("DROP DATABASE IF EXISTS %s", $this->quote_table_name($db));
        $result = $this->query($ddl);
        return $result === true;
    }

Usage Example

 /**
  * test dropping database
  */
 public function test_database_droppage()
 {
     $db = "test_db";
     //create it
     $this->assertEquals(true, $this->adapter->create_database($db));
     $this->assertEquals(true, $this->adapter->database_exists($db));
     //drop it
     $this->assertEquals(true, $this->adapter->drop_database($db));
     $this->assertEquals(false, $this->adapter->database_exists($db));
 }
All Usage Examples Of Ruckusing_Adapter_PgSQL_Base::drop_database