Create a new database.

@param string $applicationUuid
@param string $name
@return OperationResponse
488790
public function databaseCreate($applicationUuid, $name)
    {
        $options = [
            'form_params' => [
                'name' => $name,
            ],
        ];

        return new OperationResponse(
            $this->connector->request('post', "/applications/${applicationUuid}/databases", $this->query, $options)
        );
    }
971914
public function createAction($name)
    {
        if (!$this->actions->containsKey($name)) {
            throw new \InvalidArgumentException(sprintf(
                'Any action registered under "%s" name, only ["%s"] are.',
                $name,
                implode('","', $this->actions->getKeys())
            ));
        }

        return clone $this->actions->get($name);
    }
74504
public function getDatabase($name = null)
    {
        if (empty($name)) {
            $name = $this->getCurrentDatabaseName();
        }

        if (!isset($this->databasePool[$name])) {
            // init db
            $database = new Database($this, $name);
            if (isset($this->mapping[$name])) {
                $database->map($this->mapping[$name]);
            }

            // configure db
            $this->databasePool[$name] = $database;
        }
        
        return $this->databasePool[$name];
    }
848432
public function createAnonymousClient($applicationId, $applicationSecret)
    {
        return $this->createCommand()
            ->setRequest($this->client->post('client'))
            ->setBodyEntity(array(
                'application_id' => $applicationId,
                'application_secret' => $applicationSecret,
            ), 'urlencoded')
            ->setResponseClass('Maba\OAuthCommerceClient\Entity\SignatureCredentials')
        ;
    }
263483
public function databaseBackup($environmentUuid, $dbName, $backupId)
    {
        return new BackupResponse(
            $this->connector->request(
                'get',
                "/environments/${environmentUuid}/databases/${dbName}/backups/${backupId}",
                $this->query
            )
        );
    }
283973
public function createDb($name)
    {
        if (isset($name) && !empty(trim($name))) {
            $sql = "CREATE DATABASE IF NOT EXISTS `{$name}`";

            return $sql;
        } else {
            return false;
        }
    }
1073940
public static function create(
        AppUUID $appUUID = null,
        IndexUUID $indexUUID = null
    ): RepositoryReference {
        return new self($appUUID, $indexUUID);
    }
337369
public function create( $name )
	{
		$sheet = $this->_container->createSheet();
		$sheet->setTitle( $name );

		return new MW_Container_Content_PHPExcel( $sheet, $name, $this->_getOptions() );
	}
1062288
public function create($appUserId, BankAccount $bankAccount)
    {
        $url = sprintf('users/%s/bankaccounts/', $appUserId);
        return $this->createObject($url, $bankAccount);
    }
577957
public function create($uuid)
    {
        return $process = ProcessBuilder::create(
                [$this->consolePath, 'task:execute', $uuid, '--env=' . $this->environment]
            )
            ->setTimeout($this->processTimeout)
            ->getProcess();
    }
41727
function createDatabase(name, cb) {
  nano().db.create(name, function(err) {
    if(err && err.status_code !== 412) return cb(err)
    cb(null, err ? false : true)
  })
}
226937
protected function setDatabase($name) {
        if (isset($name) && !is_string($name)) throw new IllegalTypeException('Illegal type of parameter $name: '.gettype($name));
        if (!strlen($name))
            $name = null;

        $this->database = $name;
        return $this;
    }
1202035
public static void createSchema(DataSource dataSource, String name) {
        try (Connection connection = dataSource.getConnection();
             Statement statement = connection.createStatement()) {
            statement.executeUpdate(String.format(Constants.DDL_CREATE_SCHEMA, name));
        } catch (SQLException e) {
            throw new RuntimeException("Can not connect to database", e);
        }
    }
736988
public function newFriendRequestAction($name)
    {
        $logFile = $this->container->getParameter('claroline.param.claroline_log');
        $host = $this->request->query->get('host');
        //uncomment this for debugging puroposes...

        if ($this->container->get('kernel')->getEnvironment() === 'dev') {
            $fileLogger = new \Monolog\Logger('claroline.debug.log');
            $fileLogger->pushHandler(new \Monolog\Handler\StreamHandler($logFile));
            $fileLogger->addInfo(var_export($this->oauthManager->isAutoCreated($host), true));
        }

        $this->oauthManager->addPendingFriendRequest(
            $name,
            $host,
            $this->oauthManager->isAutoCreated($host)
        );

        return new JsonResponse(array('name' => $name, 'host' => $host));
    }
730210
public function createDatabase($name)
    {
        if (preg_match('@[^a-z0-9\_\$\(\)+\-]@', $name)) {
            throw new InvalidDatabasenameException(sprintf(
                'The database name %s is invalid. The database name must match the following pattern (a-z0-9_$()+-)',
                $name
            ));
        }

        if ($this->eventManager->hasListeners(Events::PRE_CREATE_DATABASE)) {
            // @codeCoverageIgnoreStart
            $this->eventManager->dispatchEvent(Events::PRE_CREATE_DATABASE, new EventArgs($this, $name));
            // @codeCoverageIgnoreEnd
        }

        $response = $this->client->request('PUT', sprintf('/%s', $name));

        if (412 === $response->getStatusCode()) {
            throw new Exception(sprintf('The database "%s" already exist', $name));
        }

        $json = (string) $response->getBody();
        $value = JSONEncoder::decode($json);

        if (isset($value['error'])) {
            throw new Exception(sprintf('[%s] Failed to create database "%s". (%s)', $value['error'], $name, $value['reason']));
        }

        $database = $this->wrapDatabase($name);

        if ($this->eventManager->hasListeners(Events::POST_CREATE_DATABASE)) {
            // @codeCoverageIgnoreStart
            $this->eventManager->dispatchEvent(Events::POST_CREATE_DATABASE, new EventArgs($database));
            // @codeCoverageIgnoreEnd
        }

        return $database;
    }
157147
protected static function getRepositoryByConfig($config, $name)
    {
        if (!is_array($config)) {
            if (class_exists($config)) {
                return new $config;
            }

            throw new Exception('Cannot create repository from string');
        } elseif ($config['driver'] == 'faker') {
            return new Faker(Factory::create());
        } elseif ($config['driver'] == 'middleware') {
            return resolve($config['middleware'])->execute(function() {
            }
            );
        }

        return static::initPdoDatabase($config, $name);
    }
1242096
public static function initPdoDatabase($config, $name)
    {
        try {
            $pdo = static::createPdoConnectionByConfig($config);
        } catch (PDOException $e) {
            throw new Exception('Cannon instantiate database connection: ' . $e->getMessage());
        }

        $pdo->uniqueName = $config['host'] . "-" . $config['db'];

        static::checkDebugBar($pdo, $name);

        return new RepositoryPDO($pdo, $name);
    }