public function execute()
 {
     $sql = $this->getSql();
     $rawSql = $this->getRawSql();
     Yii::info($rawSql, __METHOD__);
     if ($sql == '') {
         return 0;
     }
     $token = $rawSql;
     try {
         Yii::beginProfile($token, 'yii\\db\\Command::query');
         $n = $this->db->command($rawSql);
         Yii::endProfile($token, 'yii\\db\\Command::query');
         if (is_a($n, 'PhpOrient\\Protocols\\Binary\\Data\\Record')) {
             return DataRreaderOrientDB::getRecordData($n);
             // insert return record
         }
         return $n;
         // update return '0' of '1'
     } catch (\Exception $e) {
         Yii::endProfile($token, __METHOD__);
         throw new OrientDBException(__CLASS__ . " databse return error: " . $e->getMessage() . ",  When execute sql: " . $rawSql);
     }
 }
 public function one($db = null)
 {
     $this->limit = 1;
     $command = $this->createCommand($db);
     if (!empty($this->fetch_plan)) {
         $command->setFetch_plan($this->fetch_plan);
         $rows = (new DataRreaderOrientDB($command->queryOne()))->getTree();
         if (!empty($rows) && !empty($rows[0])) {
             return $rows[0];
         }
     } else {
         $rows = $command->queryOne();
         if (isset($rows['records'][0])) {
             return DataRreaderOrientDB::getRecordData($rows['records'][0]);
         }
     }
     return null;
 }