protected function selectBucket($name, $password = '')
    {
        $this->open();

        try {
            $bucket = $this->cluster->openBucket($name, $password);
        }
        catch (\Exception $e) {
            throw new Exception($e->getMessage(), (int)$e->getCode(), $e);
        }

        return Yii::createObject([
            'class'  => 'matrozov\couchbase\Bucket',
            'db'     => $this,
            'name'   => $name,
            'bucket' => $bucket,
        ]);
    }