public function SqlBase::createdb

8.0.x SqlBase.php public SqlBase::createdb($quoted = FALSE)
7.x SqlBase.php public SqlBase::createdb($quoted = FALSE)
master SqlBase.php public SqlBase::createdb($quoted = FALSE)

Create a new database.

Parameters

boolean $quoted: Quote the database name. Mysql uses backticks to quote which can cause problems in a Windows shell. Set TRUE if the CREATE is not running on the bash command line.

Return value

boolean True if successful, FALSE otherwise.

1 call to SqlBase::createdb()
SqlBase::drop_or_create in lib/Drush/Sql/SqlBase.php
Drop all tables (if DB exists) or CREATE target database.
1 method overrides SqlBase::createdb()
Sqlsqlite::createdb in lib/Drush/Sql/Sqlsqlite.php
Create a new database.

File

lib/Drush/Sql/SqlBase.php, line 256

Namespace

Drush\Sql

Class

SqlBase

Code

public function createdb($quoted = FALSE) {
  $dbname = $this->db_spec['database'];
  $sql = $this->createdb_sql($dbname, $quoted);
  // Adjust connection to allow for superuser creds if provided.
  $this->su();
  return $this->query($sql);
}