Execute

@param object $exdb ExcellentDb Object
@return null This method returns no value.
196630
public function automatic_rest_api(){
		@header('text/json; charset=UTF-8');

		$rtn = array();
		$rtn['result'] = false;
		// $rtn['options'] = $this->options;
		// $rtn['_SERVER'] = $_SERVER;
		// $rtn['_GET'] = $_GET;
		// $rtn['_POST'] = $_POST;

		if( $this->options['method'] == 'POST' ){
			// --------------------------------------
			// 投稿系リクエスト
			if( !strlen($this->options['table']) ){
				// 対象のテーブルが不明な場合はエラー
				$rtn['error'] = 'Table name not set.';
				echo json_encode( $rtn );
				return null;
			}
			if( strlen($this->options['id']) ){
				// 対象のテーブルが指定された場合はエラー
				$rtn['error'] = 'Resource ID was set.';
				echo json_encode( $rtn );
				return null;
			}

			$params = $this->options['post_params'];
			$result = $this->exdb->insert($this->options['table'], $params);
			$rtn['result'] = $result;
			$last_insert_info = $this->exdb->get_last_insert_info();
			$rtn['given_id'] = $last_insert_info->value;
			echo json_encode( $rtn );
			return null;

		}elseif( $this->options['method'] == 'GET' ){
			// --------------------------------------
			// 取得系リクエスト
			if( !strlen($this->options['table']) ){
				// 対象のテーブルが不明な場合はエラー
				$rtn['error'] = 'Table name not set.';
				echo json_encode( $rtn );
				return null;
			}

			if( !strlen($this->options['id']) ){
				// ID無指定の場合、一覧情報を返す
				$rtn['list'] = $this->exdb->select($this->options['table'], $this->options['get_params'], $this->query_options);
				$rtn['count'] = $this->exdb->count($this->options['table'], $this->options['get_params']);
				$rtn['result'] = true;
				if( count($this->table_definition->system_columns->password) ){
					foreach( $rtn['list'] as $key=>$val ){
						foreach($this->table_definition->system_columns->password as $column_name){
							unset($rtn['list'][$key][$column_name]);
						}
					}
				}
				echo json_encode( $rtn );
				return null;
			}else{
				// ID指定がある場合、詳細情報1件を返す
				$where = $this->options['get_params'];
				// $rtn['table_definition'] = $this->table_definition;
				$where[$this->table_definition->key_column] = $this->options['id'];
				$row = $this->exdb->select($this->options['table'], $where);
				$rtn['row'] = @$row[0];
				foreach($this->table_definition->system_columns->password as $column_name){
					unset($rtn['row'][$column_name]);
				}
				$rtn['result'] = true;
				echo json_encode( $rtn );
				return null;
			}

		}elseif( $this->options['method'] == 'PUT' ){
			// --------------------------------------
			// 更新系リクエスト
			if( !strlen($this->options['table']) ){
				// 対象のテーブルが不明な場合はエラー
				$rtn['error'] = 'Table name not set.';
				echo json_encode( $rtn );
				return null;
			}
			if( !strlen($this->options['id']) ){
				// 対象のテーブルが不明な場合はエラー
				$rtn['error'] = 'Resource ID not set.';
				echo json_encode( $rtn );
				return null;
			}

			$params = $this->options['post_params'];
			$result = $this->exdb->update(
				$this->options['table'],
				array(
					$this->table_definition->key_column => $this->options['id'],
				),
				$params
			);
			$rtn['result'] = ($result ? true : false);
			$rtn['affected_rows'] = $result;
			echo json_encode( $rtn );
			return null;

		}elseif( $this->options['method'] == 'DELETE' ){
			// --------------------------------------
			// 削除系リクエスト
			if( !strlen($this->options['table']) ){
				// 対象のテーブルが不明な場合はエラー
				$rtn['error'] = 'Table name not set.';
				echo json_encode( $rtn );
				return null;
			}
			if( !strlen($this->options['id']) ){
				// 対象のテーブルが不明な場合はエラー
				$rtn['error'] = 'Resource ID not set.';
				echo json_encode( $rtn );
				return null;
			}

			$result = $this->exdb->delete(
				$this->options['table'],
				array(
					$this->table_definition->key_column => $this->options['id'],
				)
			);
			$rtn['result'] = ($result ? true : false);
			$rtn['affected_rows'] = $result;
			echo json_encode( $rtn );
			return null;

		}

		$rtn['error'] = 'Unknown method';

		echo json_encode( $rtn );
		return null;
	}
138665
public function execute()
    {
        try
        {
            $stmt = $this->prepare();
            if (LOG_DEBUG == Eresus_Kernel::$logLevel)
            {
                $insider = new DBQueryInsider;
                $this->doBind($insider);
                $s = $insider->subst($this);
                Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '("%s")', $s);
            }
            $stmt->execute();

        }
        catch (PDOException $e)
        {
            throw Eresus_DB_Exception_QueryFailed::create($this, $e);
        }

        return $stmt;
    }
836667
public function exec($statement)
	{
		if($this->driver->query($statement))
		{
			return $this->driver->getRowsAffected();
		}
		else
		{
			throw new LikePDOException("Failed to execute the query ".$statement);
			return false;
		}
	}
987691
protected function _execute( $sql, $name = 'db' )
	{
		$this->_getConnection( $name )->create( $sql )->execute()->finish();
	}
1291357
public function run(?string $database, $id = null, bool $pretend = false): void
    {
        if (! \is_null($id)) {
            $this->executeFor($id, function ($entity) use ($database, $pretend) {
                $this->runUp($entity, $database, $pretend);
            });

            return;
        }

        $this->executeForEach(function ($entity) use ($database, $pretend) {
            $this->runUp($entity, $database, $pretend);
        });
    }
657974
public function execute($params = null)
    {
        $stmt = null;
        $attempt = 0;
        $retry = true;
        while ($retry) {
            $retry = false;
            try {
                $stmt = $this->stmt->execute($params);
            } catch (\Exception $e) {
                if ($this->conn->canTryAgain($attempt) && $this->conn->isRetryableException($e, $this->sql)) {
                    $this->conn->close();
                    $this->createStatement();
                    ++$attempt;
                    $retry = true;
                } else {
                    throw $e;
                }
            }
        }

        return $stmt;
    }
2807
public static function setDefaultDbo(AbstractDatabaseDriver $db = null)
    {
        self::$db = $db;

        if ($db) {
            $driver = $db->getName();

            self::$instances[$driver] = $db;
        }
    }
395410
public function execute() {
        global $DB, $CFG;

        require_once($CFG->dirroot . '/auth/mnet/auth.php');
        $mnetplugin = new \auth_plugin_mnet();
        $mnetplugin->keepalive_client();

        $random100 = rand(0,100);
        if ($random100 < 10) {
            $longtime = time() - DAYSECS;
            $DB->delete_records_select('mnet_session', "expires < ?", [$longtime]);
        }
    }
1162108
public function exec($statement, $params = array())
    {
        $this->debug($statement);
		
        $returnValue = $this->persistence->exec($statement,$params);

        $this->incrementNrOfQueries();
        return (int) $returnValue;
    }
275255
public function execSql($sql)
    {
        try {
            list ($statement) = explode(" ", ltrim($sql));
            if (in_array(strtoupper($statement), array('SELECT', 'SHOW'))) {
                $oStatement = $this->query($sql);
            } else {
                return $this->exec($sql);
            }

            return $oStatement;
        } catch (PDOException $e) {
            throw new Exception("Could not execute sql: " . $sql);
        }
    }
710246
def do_execute(self):
        
        iquery = InstanceQuery()
        iquery.db_url = str(self.resolve_option("db_url"))
        iquery.user = str(self.resolve_option("user"))
        iquery.password = str(self.resolve_option("password"))
        props = str(self.resolve_option("custom_props"))
        if (len(props) > 0) and os.path.isfile(props):
            iquery.custom_properties = props
        iquery.query = str(self.resolve_option("query"))
        data = iquery.retrieve_instances()
        self._output.append(Token(data))
        return None
816321
public function exec()
    {
        $name = $this->argument('file');
        $process = Database::export($name);
        //
        $this->show($process);
    }
641110
public function exec($sql)
    {
        if ($sql instanceof Zend_Db_Select) {
            $sql = $sql->assemble();
        }

        try {
            $affected = $this->getConnection()->exec($sql);

            if ($affected === false) {
                $errorInfo = $this->getConnection()->errorInfo();
                /**
                 * @see Zend_Db_Adapter_Exception
                 */
                // require_once 'Zend/Db/Adapter/Exception.php';
                throw new Zend_Db_Adapter_Exception($errorInfo[2]);
            }

            return $affected;
        } catch (PDOException $e) {
            /**
             * @see Zend_Db_Adapter_Exception
             */
            // require_once 'Zend/Db/Adapter/Exception.php';
            throw new Zend_Db_Adapter_Exception($e->getMessage(), $e->getCode(), $e);
        }
    }
694091
protected function exec($query)
    {
        try {
            Connect::getConn()->exec($query);
        } catch (Exception $e) {
            static::$response["status"] = "error";
            static::$response["response"] = $e->getMessage();
            static::$response["code"] = $e->getCode();

            return static::terminate(static::$response);
        }
        return null;
    }
124548
public function exec()
	{
		if ($this->query_sql === null) {
			$this->compile();
		}
		if ($this->log_query) {
			error_log(sprintf("SQL Query (exec):\n%s", $this->query_sql));
		}
		if (empty($this->query_params)) {
			$t = microtime(true);
			try {
				$r = $this->pdo->exec($this->query_sql);
				if ($this->log_query) {
					error_log(sprintf("SQL Query time: %F ms (exec).", (microtime(true) - $t) * 1000));
				}
			}
			catch (\PDOException $ex) {
				throw new FlupdoException($ex->getMessage(), $ex->getCode(), $ex, $this->query_sql, $this->query_params);
			}
			if ($r === FALSE) {
				throw new FlupdoException(vsprintf("SQLSTATE[%s]: Error %s: %s", $this->pdo->errorInfo()),
					$this->pdo->errorCode(), null, $this->query_sql, $this->query_params);
			}
			return $r;
		} else {
			$stmt = $this->query();
			return $stmt->rowCount();
		}
	}
1261749
public function exec( $statement ){
		$this->logStatement( $statement );
		try{
			$this->numberExecutes++;
			$this->numberStatements++;
			return parent::exec( $statement );
		}
		catch( \PDOException $e ){
			$this->logError( $e, $statement );										//  logs Error and throws SQL Exception
		}
	}
934420
public function execute()
    {
        $response = $this->client->allDocs(100);
        $lastKey = null;

        do {
            if ($response->status !== 200) {
                throw new \RuntimeException('Error while migrating at offset '.$offset);
            }

            $bulkUpdater = $this->client->createBulkUpdater();
            foreach ($response->body['rows'] as $row) {
                $doc = $this->migrate($row['doc']);
                if ($doc) {
                    $bulkUpdater->updateDocument($doc);
                }
                $lastKey = $row['key'];
            }

            $bulkUpdater->execute();
            $response = $this->client->allDocs(100, $lastKey);
        } while (count($response->body['rows']) > 1);
    }