create_database() public method

Create database cannot run in a transaction block so if we're in a transaction than commit it, do our thing and then re-invoke the transaction
public create_database ( string $db, array $options = [] ) : boolean
$db string the db name
$options array
return boolean
 /**
  * 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));
 }
Beispiel #2
0
 /**
  * Create a database
  *
  * @param string $name    the name of the database
  * @param array  $options
  *
  * @return boolean
  */
 public function create_database($name, $options = null)
 {
     return $this->_adapter->create_database($name, $options);
 }