Processes the SQL object and returns the SQL statement

@param SqlInterface|AlterTable $sql

@throws \Slick\Database\Exception\ServiceException
@return string
965540
public function processSql(SqlInterface $sql)
    {
        $this->_sql = $sql;
        $tableName = $sql->getTable();

        $ok = $this->_checkUnsupportedFeatures();
        if (!$ok) {
            throw new ServiceException(
                "SQLite 'ALTER TABLE' only supports the adding new columns."
            );
        }

        $addColumns = $this->_parseColumns();
        if ($addColumns) {
            $this->_statements[] = "ALTER TABLE {$tableName} " .
                "ADD COLUMN {$addColumns}";
        }

        return implode(';', $this->_statements);
    }
6382
public function execute($sql)
    {
        try{
            if(null === $this->queryType)
            {
                $this->queryType = QueryType::WRITE;
            }
            if(!$this->isInitDb)
            {
                $this->db = Db::getInstance($this->poolName, $this->queryType);
            }
            if(!$this->db)
            {
                return new Result(false);
            }
            $stmt = $this->db->prepare($sql);
            if($stmt)
            {
                if($this->defer)
                {
                    $defer = $stmt->deferExecute($this->binds);
                }
                else
                {
                    $stmt->execute($this->binds) ? $stmt : false;
                }
            }
            return new Result($stmt, $this->modelClass, $defer ?? null);
        } finally {
            $this->__init();
        }
    }
811619
public static function preparedQuery($sql) {
        self::init();
        if(!empty($exclusions = self::$_ops->getExclusions())) {
            $prepared = self::prepareStmt($sql);
            $inserts = [];
            $types = '';
            foreach($exclusions as $i => $substitute) {
                $types .= $substitute['type'];
                $inserts[] = $substitute['value'];
            }
            return self::executeStmt($prepared, $types, $inserts);
        } else {
            return self::query($sql);
        }
    }
400060
public function processSql(SqlInterface $sql)
    {
        $this->_sql = $sql;
        $template = "UPDATE %s SET %s WHERE %s";
        return sprintf(
            $template,
            $this->_sql->getTable(),
            $this->_getFieldsAndPlaceholders(),
            $this->_sql->getWhereStatement()
        );
    }
365925
public function prepare($sql)
    {
        $this->_connect();
        $stmtClass = $this->_defaultStmtClass;
        $stmt = new $stmtClass($this, $sql);
        $stmt->setFetchMode($this->_fetchMode);
        return $stmt;
    }
1103018
public function processSql(SqlInterface $sql)
    {
        /** @var CreateIndex $sql */
        $this->_sql = $sql;

        $template = "CREATE INDEX %s ON %s (%s)";

        return sprintf(
            $template,
            $this->_sql->getName(),
            $this->_sql->getTable(),
            implode(', ', $this->_sql->getColumnNames())
        );
    }
331917
public function execute($sql = null, $parameters = array()) {
		if (empty($sql)) {
			return null;
		}
		try {
			if (!empty($sql)) {
				$this->prepare($sql);
				$this->bind($parameters);
			}
			$this->result->execute();
		} catch (\PDOException  $ex) {
            if (Config::isDebug()) {
                Factory::log()->info(sprintf('PDO: %s => %s', $sql, $this->error), $parameters);
                throw $ex;
            }
			$this->error = $ex->getMessage();
		}
        return $this->result;
	}
1131920
public function execute($sql)
	{

		//put this in try...catch block for better error handling
		try{

			//check if there is a valid service instance
			if (! $this->validService() ) 
			{
				//throw exceptions
				throw new MySQLException("Not connected to a valid database service");

			}

			//execute query and return response object
			return $this->service->query($sql);

		}

		//diplay error message
		catch(MySQLException $MySQLExceptionObject){

			//display error message
			$MySQLExceptionObject->errorShow();

		}

	}
1245019
final protected function executeQuery($sql)
    {
        $statement = $this->connection->prepare($sql);
        $statement->execute();
        return $statement->fetchAll();
    }
384118
protected function getExplain($sql)
    {
        $pdo    = $this->linkID->query("EXPLAIN " . $sql);
        $result = $pdo->fetch(PDO::FETCH_ASSOC);
        $result = array_change_key_case($result);

        if (isset($result['extra'])) {
            if (strpos($result['extra'], 'filesort') || strpos($result['extra'], 'temporary')) {
                $this->log('SQL:' . $this->queryStr . '[' . $result['extra'] . ']', 'warn');
            }
        }

        return $result;
    }
897863
public function query($sql){
		LogMaster::log($sql);
		if ($this->start_from)
			$res = sqlsrv_query($this->connection,$sql, array(), array("Scrollable" => SQLSRV_CURSOR_STATIC));
		else
			$res = sqlsrv_query($this->connection,$sql);
		
		if ($res === false){
			$errors = sqlsrv_errors();
			$message = Array();
			foreach($errors as $error)
				$message[]=$error["SQLSTATE"].$error["code"].$error["message"];
			throw new Exception("SQLSrv operation failed\n".implode("\n\n", $message));
		}
		
		if ($this->insert_operation){
			sqlsrv_next_result($res);
			$last = sqlsrv_fetch_array($res);
			$this->last_id = $last["dhx_id"];
			sqlsrv_free_stmt($res);
		}
		if ($this->start_from)
			$data = sqlsrv_fetch($res, SQLSRV_SCROLL_ABSOLUTE, $this->start_from-1);
		return $res;
	}
389583
public function query($sql)
    {
        // auto reconnect
        $this->connect();
        
        //echo $sql;
        $this->statement = null; //reset 
        //echo 'adapter:'; var_dump($sql);exit;
        if (!($this->result = $this->connection->query($sql))) {
            $this->showError();
        }
        return $this->result;
    }
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);
        }
    }
853700
public function processSql(SqlInterface $sql)
    {
        /** @var CreateTable $sql */
        $this->_sql = $sql;
        $tableName = $this->_sql->getTable();
        $template = "CREATE TABLE %s (%s)";
        $parts = ArrayMethods::clean(
            [$this->_parseColumns(), $this->_parseConstraints()]
        );
        $query = [];
        $query[] = sprintf(
            $template,
            $tableName,
            implode(', ', $parts)
        );
        foreach ($this->_afterCreate as $sql) {
            $query[] = $sql;
        }
        return implode(';', $query);
    }
963217
public function query($sql)
    {
        $result = $this->pdo->query($sql);
        $this->executed[] = $sql;
        return $result;
    }
930668
public function query($sql)
    {
        try {
            $result = $this->getConnect()->query($sql);
        } catch (mysqli_sql_exception $exception) {
            $reflect = new ReflectionClass($exception);
            $property = $reflect->getProperty('sqlstate');
            $property->setAccessible(true);
            throw (new Exceptions\QueryException($exception->getMessage(), $property->getValue($exception)))
                ->setQuery($sql);
        }

        return $result;
    }
950883
public function processSql(SqlInterface $sql)
    {
        /** @var DropIndex $sql */
        $this->_sql = $sql;

        $template = "DROP INDEX %s ON %s";

        return sprintf($template, $sql->getName(), $sql->getTable());
    }